vector rewrite and inference insanity