ping to processing

Hey I am trying to use 2 ping sensors to control the position of 2 bubbles and move them along the x axis for a project. I am having trouble getting the two readings in and getting them tocontrol the movement in a organic fashion. Any help would be much appriciated.
Just been using the arduino code from the site and the procesing code is below

    import processing.serial.*;
    Serial port; // The serial port
    int[] serialInArray = new int[1]; // Where we'll put what we receive
    int serialCount = 0; // A count of how many bytes we receive
   // int xpos, ypos; // Starting position of the ball
    boolean firstContact = false; // Whether we've heard from the
    int speed = 15;
    float xpos;  // variables
    float ypos;
    float xspeed;
    void setup() {
    size(256, 256); // Stage size
    noStroke(); // No border on the next thing drawn
    // Set the starting position of the ball (middle of the stage)
    xpos = width/2;
    ypos = height/2;
    // Print a list of the serial ports, for debugging purposes:
    // I know that the first port in the serial list on my mac
    // is always my Keyspan adaptor, so I open Serial.list()[0].
    // On Windows machines, this generally opens COM1.
    // Open whatever port is the one you're using.
    port = new Serial(this, Serial.list()[0], 9600);
    port.write(65); // Send a capital A to start the microcontroller
    void draw() {
    // Draw the shape
    ellipse(xpos, ypos, 20, 20);
    // If no serial data has beeen received, send again until we get some.
    // (in case you tend to start Processing before you start your
    // external device):
    if (firstContact == false) {
    void serialEvent(Serial port) {
    // if this is the first byte received,
    // take note of that fact:
    if (firstContact == false) {
    firstContact = true;
    // Add the latest byte from the serial port to array:
    serialInArray[serialCount] =;
    // If we have 3 bytes:
    if (serialCount < 35 ) {
    xpos = serialInArray[0];
    //else (serialCount <
    //ypos = serialInArray[1];
    //fgcolor = serialInArray[2];
    // print the values (for debugging purposes only):
    //println(xpos + “\t” + ypos + “\t” + fgcolor);
    //println(xpos + “\t” + ypos);
    // Send a capital A to request new sensor readings:
    // Reset serialCount:
    serialCount = 0;