fix bugs in printmaze, everything works well