update to improve comments and tidy up code

just added in comments and removed some redundant code e.g. print