tidied up code

very nice now