Updated loop at the bottom to be better formatted.