Main update, binary search + selection sort