generalized maze movement into one method