Added wandering code, priorites