tidying up and commenting