for the PSET2 problem