elementary sorting functions are implemented