updated main for problem 17