make python3 compatible
correct solution for problem 28