Refactored euler 8 to be shorter.