speed up problem 8 by not storing the list of candidates