finally finished homework4