add distinctBy method and implement distinct in terms of distinctBy (docs need to be updated)