weight function only accepts float values

no more NaN weights