Added all the code and comments for the assignment.