Get solver to actually solve problems

- Ordering of balls is currently strict
- Dead ends are not handled well
- The cost functions are pretty much wrong
- It doesn't print out the final solution, but looking at the output it does
  the job
- etc etc (but it works)