Modified run_bgs script for run different algorithms