sorted cols matrix with bubble sort