refactored update() in Ball