Major changes to script