Remove some functions from top level.
Reorganise functions.
Handle when no solution is found.

For now it is still very simple.