CHANGED:wander function and sort of test code