added the balls functionality