add comments, clean up