Further improved script