refactored ball collision to work better