changed the code for recognition