added normalization flag to get-weighted-vectors