improved build script, now w/o bash-isms