working simple sorting rb soln