Changed logic around