Made Python3 compatible