working version of K-factor and variable statistics incorporated version (model indep)