added insertion sort to print compact func