Added callback to the pathfinder + bugfix

Added callback to the pathfinder + fixed a bug in the pathfinder where
it wouldnt generate a path for mazes of not the same height/width
(because width/height where wrong)