modified HW2 & lab4