adapted to tarball/2