Added functionality to resize div inside createDiv function.