update class 4 for python 3 compatibility