fixed issue with small range
modified build script to make this a stand-alone program