w.avg(): more cleaning up internal functions & roxygen documentation