cleaned up spells code