enclosed code in function to avoid gm namespace pollution