Made Python 3 compatible