Fixed some bugs. Added recognize_J function.