Completed createDiv function.