pset11/problem 3, still without any debugging or testing