Finished insertion sort, added count sort for matrices