add max_pkg_fn()