Adding check if xhat is in B(f)