tweak to Assignment 3 problem 2