Removed the errors in most functions. The Controller still needs the Logic(), CalculateOffset() and CalculateTransitions() functions. These will be debugged seperately.

Next step is merging this branch back into the main branch and removing the debug specific code.