Added pack function