Updated code for Processing 2
Updated code to work with Processing 2.x