implement grimoire reading and writing