added third previous ball, using arrays