non-looped maze solving