Add comments on how the code works.