Program 10.4b - without warnings