Updated the functionality by adding extra functionality distinct, or_where etc.