Added casting of spells
Cleaned up ruby code