adding in the b-tilde calculation function. This is unique to this project