todo make sort explicit so we can predict return order