Made some changes to script