Updated to use new-style classes in python