private void createFailureEvent(int id, int eventType, double startTime, double endTime, boolean flag) {
    
    // with this option we could start the failure from anywhere in the trace file
	if (startTime-TraceStartTime < 0)
    	return;

    if (nodeEvent==null){
    	nodeEvent = new FailureEvent(id,eventType,startTime-TraceStartTime,endTime-TraceStartTime);
    	addtolist = false;

    }else{
    if (flag){
    	events.add(nodeEvent);
    	nodeEvent = new FailureEvent(id,eventType,startTime-TraceStartTime,endTime-TraceStartTime);
    	addtolist = false;
    }
    else{
	nodeEvent.insertEvent(id,eventType,startTime-TraceStartTime,endTime-TraceStartTime);
    }
    }
}