update documentation and tests for stat weights
code cleanup