changed insertion method