Fixed problem 4 in project euler