Add serialization to distribution, NOT TESTED