delete k from global memory  and use it locally