added a couple of  hg functions