Wrote a marginalize function but I don't know if I like the way it's set up. Also, I have to watch for the case that a user tries to marginalize out the child