Removed extraneous for loop in main.