Adjusted main script.