Allow output of simple or weighted average
Merge commit 'd2de' into preserve-imperative-weighting