DJP Algorithm