updated genMainProg.sh