added spiff to script and cleaned up the script a bit