Update functions and Add comments

As per the assignment directions.