Add capitalization to loop code