update code to calculate se of coefs