solved in python3