Changed conditions for d in freq