updated to keep fractional weights