tidy up rough working verson ready for refactoring