public void run() {
       
        Random randomNum = new Random();

      try{
        DatagramSocket listenSocket = new DatagramSocket(listenPort);
        //change this shit later
        DatagramSocket forwardSocket = new DatagramSocket();
           
           byte[] receiveData =  new byte[90];
           byte[] sendData = new byte[90];

        while(true)
        {
             DatagramPacket receivePacket = new DatagramPacket(receiveData,receiveData.length);
               
               String received = new String(receivePacket.getData());
             
               listenSocket.receive(receivePacket);
               
               receiveData = receivePacket.getData();
               
               ByteArrayInputStream in = new ByteArrayInputStream(receiveData);
               ObjectInputStream is = new ObjectInputStream(in);
               
               try{
                   String rAddr = receivePacket.getSocketAddress().toString();
                   Packet packet = (Packet) is.readObject();
                   //packet.toString();
                   System.out.println("RX | #"+packet.getSeqNum()+" | "+paxType(packet.getPacketType())+" FROM "+ rAddr);
                   
                   //Packets will be dropped randomly when bit error rate is less than or equal to the rndom nmber generator        
                    if(drop >= 1 && drop <= 100)
                    {
                        int randomInt = randomNum.nextInt(100) + 1;
                        if (randomInt <= drop)
                        {
                            if(packet.getPacketType()==3 || packet.getPacketType()==5){
                                System.out.println("This is an EOT or EOTACK");
                                System.out.println("DO NOT DROP");
                            }
                            else{
                            System.out.println("\n\n**DROP PACKET "+packet.getSeqNum()+"**\n\n");    
                            continue;
                            }

                            
                        }
                    }
                    else
                    {
                        System.out.println("The maximum is 100, try again");
                    }
                   
                    //DELAYY
                    Thread.sleep(Network.timer);
                   //SERIALIZE packet back down into byte stream
                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                    ObjectOutputStream os = new ObjectOutputStream(outputStream);
                    os.writeObject(packet); 
                    sendData = outputStream.toByteArray();
                    DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, sendAddr ,forwardPort );
                    System.out.println("sendaddr " + sendAddr);
                    forwardSocket.send(sendPacket);
                    //System.out.println("TX to "+forwardSocket.getInetAddress());
                     System.out.println("TX | #"+packet.getSeqNum()+" | "+paxType(packet.getPacketType())+" TO  "+sendAddr+":"+forwardPort  );
               }
               catch(Exception e){
                   e.printStackTrace();
               }
        }
        }
        catch (IOException e)
        {
            System.out.println("io exception"); 
        }
   }