remove debug, add comments