Added element insertion routine