insertion sort as rule application