shouldn't this `toinsert` be `element`?