Added some comments for clarification.