Tidied up code a little more indented some things to make it cleaner :)