Corrected has_ace function