added alternative syntax;
corrected alternative syntax; removed display_function and moved foreach loop to html body