added spell function