Changed project euler solution for clarity