implemented global vars on maze, stack level too deep