script fleshed out to the end