Program 5 for CS354 Class