updated to keep fractional weights

and added a few other explanatory comments :-)