minor code cleaning and added basic comment.