Slight modification to Problem3 Code