implemented global keyword computation