Project Euler 35 - Sorted out prime numbers creation but not in a good way