algo3: hw3: problem2: tried problem 4, 5