HW3 part3 (before full debug)