My attempt at project euler