Changed logic for double counting