I propsose the idea to @asdf123 to clean the code up. It is very messy. Plus this code needs to be written as an API. I don't like scripts like that. I'll rewrite this code tomorrow when I'm not on an iPad.