Homework 4 first attempt