build script is now a little more sophisticated