added serialize()