modified edf

FIX : Added function nextEvent to find next occurrence of event and
accordingly put the scheduler to sleep :+1: