updated to python3 syntax