Added sortedInsert