Added utf-8 encoding for python3
tidying up loose ends