At first glance, this function looks identical to the `pack` function that @mramato already added.