added comments, small fixes