Added unpack function (unit test in progress)