implemented most basic parts of hgpkg