Adds more detailed comments for explanation.