tidied up a bit