implment globals vs locals