implement `compare` and `sort`
add to api docs