just a bit of a tidy up and some commenting