variance function with option