Tidied code up
Commited remaining stuff