Implemented maze solver code.