functions to dynamically update the page