finished and commented on code for video 51