minor change to hadding method to allow weights vector to be larger than input files vector