added __hash__ + __eq__ methods to base class, + PEP8 fixes