add Python 3 compatibility