public void tick() {

        Street end1 = streets.get(streets.size()-1);
        for(Vehicle vdel:end1.getVehicles()) {
            end1.leaveStreet(vdel);
            vehicles.remove(vdel);
            System.out.println("VEhicle removed: " + vdel);
        }


        for(Intersection i: intersections) {
            i.iteratePhase();
        }

        for(Vehicle vehicle : vehicles){
            vehicle.calcNewPos();


        }

        for(Vehicle v: vehicles) {
            v.move();
        }

        if(Math.random()<NEW_CAR_RATIO) {
            Street enter1 = streets.get(streets.size()-2);
            // test if startpoint is free
            int lane = ((int)(Math.random() * 100)) % enter1.getNumOfLanes();
            Vehicle first = enter1.getFirstVehicle(lane);
            if(first != null) {
                if(first.getPosition().x != enter1.getLaneStart(lane).x || first.getPosition().y != enter1.getLaneStart(lane).y) {
                    vehicles.add(new Vehicle(streets.get(streets.size()-2),lane,"VX"));
                } else {
                    System.out.println("WHAAAAT");
                }
            } else {
                vehicles.add(new Vehicle(streets.get(streets.size()-2),lane,"VX"));
            }

        }

        vehiclePanel.repaint();
        controlPanel.updateTime();
    }