some minor corrections to the maths, added group variance equation