Fixed up the first problems with the script