adjusts problem 22 to take out random numbers