Updated bp.py : Added if condition which calls main