updated code to work with Processing 2.0