added unpack functionality