Sort statements by rank