adding replacing divs functionality