Changed line-ends to same style (Unix style so it's easier to re-use code)
Break blocks so it's easier to read code
More Breaking blocks so it's easier to read code
Intending switches
Re-formated so all intendation is made with spaces and removed all tabs
Re-intented all switched and cases
All if should have branckets
Made sure everything is with java style brancketing which is current coding style
Same padding everywhere. variable = something or if something < something2
All functions now enter before