Implemented sort_by_columns