Added some comments/explanations.