Added more functionality to balance_ball.js