implemented bias calculation