Function hg also receives Gem
New fucntion: betti, receives gem