Tidied up and commented

Made it more object oriented. I.e. objects now act mostly on there own
data