changed list comparator to map comparator so order is irrelevant