Added direction constants, moved some stuff into the function

Added direction constants, enhances code reability.

Realised I was being stupid about controlled the LEDs, moved the code
into the function.