Modified code to use <% %> and <%= %>