Add comments and tidy up some more