Still stuck. Restarting from scratch I'm sure.

Figure I'll deal with the foreach being slow, and look to see if a for
loop is faster