tidy up add some documentation