What does 12 have to do with anything? Where is the actual code for the points?

Looping and searching in such a way is very inefficient, see this post for a better starting point: http://forum.swiftirc.net/viewtopic.php?p=209311&sid=c12773d99a0e2dcee18eef90190f4790#p209311