better maze algo