added //JT: comments in code (my comments after code review)