working EDF - improvements needed