Added variance calculation