got variance calculation working