solves maze