Blastoise: Instead of all those if statements, simplify it like so: IF B AND #UP IF B AND #DOWN IF B AND #LEFT IF B AND #RIGHT That way it compares the binary numbers through a bitwise AND gate, the code is much cleaner and faster