Continued Refactoring of Solution 10

Trying to speed it up