adapted to tarball/5