added additional comments for clarity