BP algorithm tuning

Suggested changes for BP