made corrections to code for DOM exercise