add mousePressed() to modify the array