First functional version of Problem3