updated build script for distribution