added the implementation for terrainFunction
findChar working but ugly
better findChar, however subvector traversed twice
small functions
added neighbors
Solver does not find an optimal solution yet
seems that works
cleanup