Modified MagicBall.rb