new serialization code for GP