move code for calculating 2 sigma into private method