Mostly tidied up...stuff