Updated BPC algorithm