half of program transferred into funcions
All actions now done by funcions
Merge branch 'functionSplit'
Program is now split into funcions