finished half of the assignment