vecSize is probably irrelevant. Why not use shape of keys and/or values to compute vecSize?