Flesh out write, tests do not currently pass