cleaned up Distinct and added Tests