implemented AddReferences struct and serialization. compiles, not tested