Homework 5.1 done and tested