Adding BP from Kaveh's version