added sorting by columns