Improved the building script