Script to automatically rebuild