add comments, remove debug prints