clean up code of maze solver