First attempt at problem 99, takes a long time, and fails to give the proper answer