add num_pieces and piece_offsets