more comments, code cleanup