Not clear what is pkg... Could you add a better docstring?