Index: proiecte/ptvs/src/vnsim/core/Engine.java
===================================================================
--- proiecte/ptvs/src/vnsim/core/Engine.java	(revision 61)
+++ proiecte/ptvs/src/vnsim/core/Engine.java	(revision 76)
@@ -653,6 +653,7 @@
 		int numThreads=intersectii.size();
 		
-		EventProcessingThread processingThreads[] = new EventProcessingThread[numThreads];
-		
+		//v1
+		Runnable processingThreads[] = new Runnable[numThreads];
+		//
 		
 		while (true) {
@@ -665,4 +666,5 @@
 			// extrag un eveniment din coada !!!!! acum doar il extrag.. cand intru in playEvent il si scot cu remove(0)
 			Event e = (Event) eventQueue.get(0);
+			if (e == null) continue;
 			System.out.println("\n----------- number of events in the queue:"+eventQueue.size() );
 			
@@ -675,5 +677,5 @@
 		
 			if((e instanceof SendEvent) || (e instanceof ReceiveEvent)){
-				
+				e = (Event)eventQueue.remove(0);
 				/**
 				 * Mihaela Teler
@@ -726,14 +728,14 @@
 						
 							System.out.print("SendEvent: ");
-							processingThreads[indexClosestIntersection] = new SendEventProcessingThread(e,crtTime);
+							processingThreads[indexClosestIntersection] = new SendEventProcessingThread(e,this);
 						}
 					else {					
 							System.out.print("ReceiveEvent: ");
-							processingThreads[indexClosestIntersection] = new ReceiveEventProcessingThread(e,crtTime);
+							processingThreads[indexClosestIntersection] = new ReceiveEventProcessingThread(e,this);
 						}
 					
 					System.out.println("Processing thread "+indexClosestIntersection+" from intersection "+intersectii.get(indexClosestIntersection));
 					//processingThreads[indexClosestIntersection].start();// cu start nu merge ... why????
-					processingThreads[indexClosestIntersection].run();
+					new Thread(processingThreads[indexClosestIntersection]).start();
 					cnt++;
 				}
@@ -743,5 +745,5 @@
 			
 			else if (e.getTime() == crtTime) {
-				playEvent();
+				playEvent(null);
 				cnt++;
 			} else
@@ -988,5 +990,5 @@
 	 * 
 	 */
-	public static void playEvent() {
+	public void playEvent(Event ev) {
 		
 		//System.out.println(">> Thread:"+Thread.currentThread().getName());
@@ -998,7 +1000,9 @@
 
 		Event e = null;
+		if (ev == null) {
 		synchronized (eventQueue) {
 			e = eventQueue.remove(0);
 		}
+		} else e = ev;
 		//System.out.print(e.toString()+", ");
 		//System.out.flush();
Index: proiecte/ptvs/src/vnsim/core/EventProcessingThread.java
===================================================================
--- proiecte/ptvs/src/vnsim/core/EventProcessingThread.java	(revision 61)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package vnsim.core;
-
-public interface EventProcessingThread {
-	
-	public void run();
-
-}
Index: proiecte/ptvs/src/vnsim/core/ReceiveEventProcessingThread.java
===================================================================
--- proiecte/ptvs/src/vnsim/core/ReceiveEventProcessingThread.java	(revision 61)
+++ proiecte/ptvs/src/vnsim/core/ReceiveEventProcessingThread.java	(revision 76)
@@ -5,13 +5,13 @@
 
 
-public class ReceiveEventProcessingThread extends Thread implements EventProcessingThread{
+public class ReceiveEventProcessingThread implements Runnable {
 	
-	ReceiveEvent e;
-	int crtTime;
+	final ReceiveEvent e;
+	final Engine engine;
 	
 	
-	public ReceiveEventProcessingThread(Event e, int crtTime){
+	public ReceiveEventProcessingThread(Event e, Engine engine){
 		this.e=(ReceiveEvent)e;
-		this.crtTime=crtTime;
+		this.engine=engine;
 		
 	}
@@ -19,5 +19,5 @@
 	public void run() {
 		
-		Engine.playEvent();
+		engine.playEvent(e);
 	
 	}
Index: proiecte/ptvs/src/vnsim/core/SendEventProcessingThread.java
===================================================================
--- proiecte/ptvs/src/vnsim/core/SendEventProcessingThread.java	(revision 61)
+++ proiecte/ptvs/src/vnsim/core/SendEventProcessingThread.java	(revision 76)
@@ -5,13 +5,13 @@
 
 
-public class SendEventProcessingThread extends Thread implements EventProcessingThread{
+public class SendEventProcessingThread implements Runnable{
 	
 	SendEvent e;
-	int crtTime;
+	Engine engine;
 	
 	
-	public SendEventProcessingThread(Event e, int crtTime){
+	public SendEventProcessingThread(Event e, Engine engine){
 		this.e=(SendEvent)e;
-		this.crtTime=crtTime;
+		this.engine=engine;
 		
 	}
@@ -19,5 +19,5 @@
 	public void run() {
 		
-			Engine.playEvent();
+			engine.playEvent(e);
 		
 	}
