general processing script