Updated rebuild script