*hangs head shamefully* this python needs some serious refactoring. hopefully i can find someone who knows python better