Added explanations and comments