some tidying + comments