update background and some insertion sort