code snippets of SpellMaster prj