Fixing end detection
Yay everything is working fine and I just finihed the puzzle