adding confidence counting and regression fit