HW5 for cs369