My code is working but does not satisfy the condition, any help please?