Using $PROGNAME for build.sh
Code cleanup