Implement elementary sorts