Vectors are traversed backwards in neighbor(), no need to inverse them explicitly.