added explanations to my code and analysis