insert nodes function must accept an array of nodes too