Re-wrote build script in python.