made the ball function create balls instead of refering to something outside