complete vq algorithm