make sorting an array instead of hash