implemented Edf algorithm