Code tidy up by Connor Parks, Tested