added comments, small corrections