Added code for bias correction