The output is correct but still the conditions are incorrect. Any help?