basic explanation of J_c algorithm