Updated Program 5