It was broken :P
Scakk just showed it, so I went and fixed it :D
Also using % 3 in $calc is much more efficient