Implementation of compress and pack for nnhp