rand sort
a few fixes
rand compare