improved script