updating DOM based on input