refactored the code for the ball splash