more comments, minor code cleaning