updated to compile with python3