Need help with Monski Pong syntax

I am working with the book "Making Things Talk" and am having some trouble with the Monski pong project and I would really appreciate some help understanding why it doesn't work.

I have been able to make the Monski Pong program work but then the author suggest (@page68) adding some code to make the interface more interactive, smoother. So I added the suggested code to both the Arduino and the Processing scripts and now the pong interface will draw it's self but appears to not receive the signal from the arduino. Therefore I am unable to interact with the GUI.

I have pasted the code below. I will highlight in blue the additional text the author suggested I add.
Note: This program does work, once I added the additional text the program stopped working. The purpose of adding the additional text was to make the game play smoother.

Arduino script:

/*
Sensor Reader
Language: Arduino

Reads two analog inputs and two digital inputs and Outputs their values.

Connections: analog sensors on analog input pins 0 and 1
switches on digital I/O pins 2 and 3.

*/

int leftSensor = 0;
int rightSensor =1;
int resetButton =2;
int serveButton =3 ;

int leftValue =0;
int rightValue =0;
int reset = 0;
int serve = 0;

void setup() {
//configure the serial connector
Serial.begin(9690);
//config digital inputs:
pinMode(resetButton, INPUT);
pinMode(serveButton, INPUT);

while (Serial.available() <= 0) {
Serial.print('\r',BYTE); //send a return character
delay(300);
}
}

void loop() {
//check to see whether there is a byte available
//to read in the serial buffer
if (Serial.available() >0) {
//read the serial buffer: You dont care about the value
//of the incoming bytes just that one was sent.
int inByte = Serial.read();
leftValue = analogRead(leftSensor);
rightValue = analogRead(rightSensor);

//read the digital sensor:
reset = digitalRead(resetButton);
serve = digitalRead(serveButton);

//print the results:
Serial.print(leftValue, DEC);
Serial.print(",");
Serial.print(rightValue, DEC);
Serial.print(",");
Serial.print(reset, DEC);
Serial.print(",");
//print the last sensor with a println() so that
//each set of 4 reading prints on a line by itself:
Serial.println(serve,DEC);
}
}

Processing:

/* Serial String Reader
Language: Processing

reads in a string of characters from a serial port
until it gets a line feedback (ASCII 10).
Then splits the string into sections seperated by commas.
Then converts the sedtions to ints, and prints them out.
*/

import processing.serial.*; //import the Processing serial library

int linefeed =10; //Linefee in ASCII
Serial myPort; //The serial port

float leftPaddle, rightPaddle; //varables for the flex sensor values
int resetButton, serveButton; //var for the button values
int leftPaddleX, rightPaddleX; //horizontal pos for the paddles
int paddleHeight =50; //vertical dimentions for the paddles
int paddleWidth = 10; //horizonatl dimentions for the paddles

float leftMinimum = 100;
float rightMinimum = 100;
float leftMaximum = 425;
float rightMaximum = 425;

int ballSize = 10;
int xDirection = 1;
int yDirection = 1;
int xPos, yPos;

boolean ballInMotion =false; // whether the ball should be moving
int leftScore = 0;
int rightScore = 0;

PFont myFont;
int fontSize =36;

boolean madeContact = false;

void setup() {
// set window size:
size(640,480);

//initialize the ball in the center of the screen
xPos = width/2;
yPos = height/2;

// List all the available serial ports
println(Serial.list());

//Change the 0 to the apropriate number numberd serial port
myPort = new Serial(this, Serial.list()[1], 9600);

//read bytes into a buffer until you get a line feed (ASCII 10):
myPort.bufferUntil(linefeed);

// initialize the sensor values:
leftPaddle = height/2;
rightPaddle = height/2;
resetButton = 0;
serveButton = 0;

//initialize the horizontal paddle position:
leftPaddleX = 50;
rightPaddleX = width - 50;

//set no boarders on drawn shapes:
noStroke();

//creat a font with a third font available to the system
PFont myFont = createFont(PFont.list()[2], fontSize);
textFont(myFont);
}

void draw(){
background(0);
//draw the left paddle:
rect(leftPaddleX, leftPaddle, paddleWidth, paddleHeight);

//draw the right paddle:
rect(rightPaddleX, rightPaddle, paddleWidth, paddleHeight);

//calculate the balls pos and draw it
if (ballInMotion == true) {
animateBall();
}

//if the serve button is pressed, start the ball moving
if (serveButton == 1 ) {
xPos = width /2;
yPos = height/2;
ballInMotion = true;
}
//if the reset button is pressed rest the score and start the ball moving
if (resetButton ==1 ) {
xPos = width /2;
yPos = height/2;
leftScore = 0;
rightScore = 0;
ballInMotion = true;
}

//print the scores
text(leftScore, fontSize, fontSize);
text(rightScore, width-fontSize, fontSize);
}

//serialEvent method is run automatically by the Processing sketch
//whenever the buffer reaches the byte value set in the bufferUntil()
//method in the setup():

void serialEvent(Serial myPort) {
//if serialEvent occurs at all, contact with the microcontroller
//has been made
if(madeContact == false) {
myPort.clear(); //clear the serial port buffer
madeContact = true;
myPort.write('\r');
}

//read the serial buffer:
String myString = myPort.readStringUntil(linefeed);

//if you got any bytes other than the linefeed:
if (myString !=null) {

myString = trim(myString);
//slit the string at the commas
//and convert the sections into intergers:
int sensors[] = int(split(myString, ','));
//If you recieve all the sensor strings, use them:
if (sensors.length ==4) {
//calclate the flex sensors ranges:
float leftRange = leftMaximum - leftMinimum;
float rightRange = rightMaximum - rightMinimum;

//scale the flex sensors results to the paddles ranges:
leftPaddle = (height * (sensors[0] - leftMinimum) / leftRange)-220;
rightPaddle = (height * (sensors[1] - rightMinimum) / rightRange)-70;

//assign sensor strings values to the appropriate varables:
//leftPaddle = sensors[0];
//rightPaddle = sensors[1];
resetButton = sensors[2];
serveButton = sensors[3];

//print out the varables:
print("left: "+ leftPaddle + "\tright: "+rightPaddle);
println("\treat: "+ resetButton + "\tserve: " + serveButton);

//send out the serial port to ask for data
myPort.write('\r');
}
}
}

void animateBall() {
//if the ball is moving left:
if (xDirection <0) {
//if ball is to the left of the left paddle
if((xPos <= leftPaddleX)) {
//if the ball is in between the top and the bottom of the left paddle
if((leftPaddle - (paddleHeight/2) <= yPos) &&
(yPos <= leftPaddle + (paddleHeight /2))) {
//reverse the horizontal dorection
xDirection = -xDirection;
}
}
}
//else if ball is moving right
else{
//if the ball is to the right of the right paddle
if ((xPos >= (rightPaddleX + ballSize/2))) {
//if the ball is in between the top and the bottom of the right paddle
if ((rightPaddle - (paddleHeight/2) <=yPos) &&
(yPos <= rightPaddle + (paddleHeight /2))) {
//reverse the horizontal driection
xDirection =-xDirection;
}
}
}
//if the ball goes off the screen left
if(xPos <0) {
rightScore++;
resetBall();
}
//if ball goes off screen right
if(xPos>width) {
leftScore++;
resetBall();
}

//stop the ball going off the top and bottom of the screen
if ((yPos -ballSize/2 <= 0) || (yPos +ballSize/2 >=height)) {
//reverse Y direction of ball
yDirection = -yDirection;
}
//update the ball position
xPos = xPos + xDirection;
yPos = yPos + yDirection;

//Draw the ball
rect(xPos, yPos, ballSize, ballSize);
}

void resetBall() {
// put the ball back in the center
xPos = width /2;
yPos = height/2;
}

Can anyone help with this ?
Have I posted it to the wrong part of the forum ?