Changed things to fit Python 3