Added event-based scheduling implementation (need debuging)