Added ball collision and random number generator