completed hw6. (why is hwk4 modified??)