Program 2 for ECE 506