deleted functions and added variance control