@Override
    public void serialEvent(SerialPortEvent serialPortEvent) {
        //mucho mucho bulk of logic goes here!
        if (serialPortEvent.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
            try {
                int available = input.available();
                byte chunk[] = new byte[available];
                input.read(chunk, 0, available);
                String data = new String(chunk);
                this.outdata = this.outdata + data;
                //System.out.print(data);
                if (data.contains("ready")){
                    this.ready = true;
                    this.outdata = "";
                }
                //System.out.println(data.substring(Math.max(data.length() - 2, 0)));
                if (this.outdata.endsWith("tt")){
                    //We have a complete data line to process
                    //How are we going to process these... state machine or add a shadowed
                    //command form on the arduino side to deal with machine commands?
                    //the first byte is the command that was called
                    if (this.outdata.startsWith("1")){
                        //This is the current settings for each of the servos!
                        //update our internal mappings to make stuff be happy
                        this.outdata = this.outdata.substring(1,this.outdata.length()-2);
                        String[] lines = this.outdata.split("\t");
                        for (String line: lines){
                            String[] thisData = line.split(",");
                            if (this.servos[Integer.valueOf(thisData[0])] == null){
                                this.servos[Integer.valueOf(thisData[0])] = new Servo();
                            }
                            this.servos[Integer.valueOf(thisData[0])].setPosition(Integer.valueOf(thisData[1]));
                            this.servos[Integer.valueOf(thisData[0])].setMin(Integer.valueOf(thisData[2]));
                            this.servos[Integer.valueOf(thisData[0])].setMax(Integer.valueOf(thisData[3]));
                            this.servos[Integer.valueOf(thisData[0])].setUpright(Integer.valueOf(thisData[4]));
                        }
                    }
                }
            } catch (Exception e) {
                System.err.println(e.toString());
            }
        }
        // Ignore all the other eventTypes, but you should consider the other ones.
    }