Added some code explanations.