Completed Part C main programming