vector centering function