Maze 5.1

Added algo with Dennis's implementation rather than mine