Changed B function