updated for part3 of hw3