Detailed ball collection algorithm