Added sortColumns medthod and changed array size to rows x cols