added commentary to explain what happens