added serializing capability