Homework 6 first attempt