Add HW3 functionality