Added unpack function