Updated ball logic