improved getnextmove by using coordinates, so dont have to worry if nodeindex exists for wall or not