solve maze using only right-hand rule