Working on problem 166