connected sort function to note array. not functional