finished homework assignment for week2