Created controller code to work by flags rather than by simple
event-based key presses, this results in a much smoother operation