re-write build script