modified like HW4