Add ten puzzle solver
Refactoring