EDcond function added