working on unpacking messages