Improved structure of maze saving :)