new script

setcode still needs to be changed