changed ED function to work with mapply, removed obsolete TransToED function