added glboal functions