lab 3 reworked with parts array code