actual optimal marshalling requires a topological sort and i'm saving that for later