fix unpack routine after some clarifications.