Modified bash scripts to run bgs and pmbgs