improved abstract maze solver