I am debugging my algorithm for it, It works properly on the serial monitor but does not work in real life