Added explanations in the comments