don't write to file and make it work for python3 as well