fixes in sending maze
small refactoring in maze generation