Fully completed HW3 assignment