Adding ball collision handling.