script global functions