Solution code for Project Euler