array sort

@stevan: missed including this one in my previous pull request.