In-Class code for Program 5