Added code for dynamic creation of div elements