This is severely broken :)
You'll laugh when you see it. 
Either way, I'd vote for getting rid of that crazy string mess above and use lists instead.