Slight adjustment to script, problem remains. (Inner classes solution here: http://tomayko.com/writings/python-inner-classes)