Second try of Program 3