added a index_i for the handling of the ySpeed of the different balls