added a icompile friendly bouncingBall method