packed modified function