Began a soution for problem 30