some tidy-up
Dave's version added
tidy up for Dave's