HW 4

Completed code for all the answers for HW4.