rebuilding script