Some code clarification by adding comments