tidied up stuff