most of the script