last session before happy hour. I appreciate all of you for hanging around this long. Maybe you're here because you don't know, there's a bar on the first floor of this hotel. I think that is where the main track is currently taking place. I am Austin Putman. I am the VP of engineering for OMADA Health. At OMADA, we support people at risk of chronic disease like diabetes, make crucial behavior changes, and have longer, healthier lives. So it's pretty awesome. I'm going to start with some spoilers because I want you to have an amazing RailsConf. So if this is not what you're looking for, don't be shy about finding that bar track. We're going to spend some quality time with Capybara and Cucumber, whose flakiness is legendary for very good reasons. Let me take your temperature. Can I see hands? How many folks have had problems with random failures in Cucumber or Capybara? Yeah. Yeah, this is reality, folks. We're also going to cover the ways that RSpec does and does not help us track down test pollution. How many folks out there have had a random failure problem in the RSpec suite, like in your models or your controller tests? Okay, still a lot of people, right? It happens, but we don't talk about it. So in between, we're going to review some problems that can dog any test suite. Is it like random data, time zone heck, external dependencies? All of this leads to pain. There was a great talk before about external dependencies. Just, here's just a random one. How many people here have had a test fail due to a daylight savings time issue? Yeah.  Let's talk about eliminating inconsistent failures in your tests. And on our team, we call that fighting randos.  I chose to try to hit deadlines instead of focusing on build quality. And our team paid a terrible price. Anybody out there paying that price? Anybody out there feel me on this?  So let's do some science. Some problems seem to have more random failure problems than others. I want to gather some data.  Right? Wow, I love RailsConf. Keep your hand up if you believe you have experienced a random test failure. The whole room. Now, if you think you're likely to have one in the next like four weeks, who's out there? It's still happening, right? You're in the middle of it. Okay, so this is not hypothetical for this audience. This is a widespread problem. But I don't see a lot of people talking about it. And the truth is, while being a great tool, a comprehensive integration suite is like a breeding ground for baffling heisenbugs. So to understand how test failures become a chronic productivity blocker, I want to talk a little bit about testing culture. Right? Why is this even bad? So we have an automated CI machine that runs our full test suite every time a commit is pushed. And every time the build passes, we push the new code to a staging environment for acceptance. Right? That's our process. How many people out there have a setup that's kind of like that? Okay, awesome. So a lot of people know what I'm talking about. So in the fall of 2012, we started seeing occasional unreproducible failures of the test suite in Jenkins. And we were pushing to get features out the door for January 1st. And we found that we could just rerun the build and the failure would go away. And we got pretty good at spotting the two or three tests where this happened. So we would check the output of a failed build and if it was one of the suspect tests, we would just run the build again. Not a problem. Staging would deploy. We would continue our march toward the launch. But by the time spring rolled around, there were like seven or eight places causing problems regularly. And we would try to fix them. You know, we wouldn't ignore them, but the failures were unreliable. So it was hard to say if we had actually fixed anything. And eventually we just added a gem called cucumber rerun. Yeah. And this just reruns the failed specs if there's a problem. And when they passed the second time, it's good. You're fine. No big deal. And then some people on our team got ambitious. And they said we could make it faster. We could make CI faster with the parallel test gem, which is awesome. But cucumber rerun and parallel tests are not compatible. And so we had a test suite that ran three times faster, but failed twice as often. And as we came into the fall, we had our first bad Jenkins week. On a fateful Tuesday, 4 p.m., the build just stopped passing. And there were anywhere from like 30 to 70 failures. And some of them were our usual suspects and dozens of them were like previously good tests, tests we trusted. And so none of them failed in isolation, right? And after like two days of working on this, we eventually got a clean R spec build, but cucumber would still fail. And the failures could not be reproduced on a dev machine or even on the same CI machine outside of the whole build running. So over the weekend, somebody pushes a commit and we get a green build. And there's nothing special about this commit, right? Like it was like a comment change. And we had tried a million things and no single change obviously led to the passing build.  Like pretty good. So we could push stories to staging again and we're still under the deadline pressure, right? So we shrugged and we moved on, right? And maybe somebody wants to guess what happened next, right? Yeah, it happened again, right? A whole week of just no tests passed. The build never passes. So we turn off parallel tests, right? Because we can't even get like a coherent log of which tests are causing errors. And then we started commenting out the really problematic tests. And there were still these like seemingly innocuous specs that fail regularly, but not consistently. So these are tests that have enough business value that we are very reluctant to just like delete them. And so we reinstated cucumber rerun and it's buddy, our spec rerun. And this mostly worked, right? So we were making progress. But the build issues continue to show up in the negative column in our retrospectives. And that was because there were several problems with this situation, right? Like reduced trust. When build failures happen four or five times a day, those aren't a red flag. Those are just how things go. And everyone on the team knows that the most likely explanation is a random failure. And the default response to a build failure becomes run it again. So just run it again, right? The build failed whatever. So then occasionally we break things for real. But we stopped noticing because we started expecting CI to be broken. Sometimes other pairs would pull the code and they would see the legitimate failures. Sometimes we thought we were having a bad Jenkins week. And on the third or fourth day we realized we were having actual failures. This is pretty bad, right? So our system depends on green builds to mark the code that can be deployed to staging and production. And without green builds, stories can't get delivered and reviewed. So we stopped getting timely feedback. Meanwhile, the reviewer gets like a week's worth of stories all at once, big clump. And that means they have less time to pay attention to detail on each delivered feature. And that means that the product is a little bit crappier every week. So maybe you need a bug fix. Fast. Forget about that. You've got like a 20% chance your bug fix build is going to fail for no reason. Maybe the code has to ship because the app is mega busted. In this case, we would rerun the failed tests on our local machine and then cross our fingers and deploy. So in effect, our policy was if the code works on my machine, it can be deployed to production. So at the most extreme, people lose faith in the build and eventually they just forget about testing. And this didn't happen to us. But I had to explain to management that key features couldn't be shipped because of problems with the test server. And they wanted to know a lot more about the test server. And it was totally clear that while a working test server has their full support, an unreliable test server is a business liability and needs to be resolved. So the test server is supposed to solve problems for us. And that is the only story that I like to tell about it. So we began to fight back. And we personified the random failures. They became randos, a rando attack, a rando storm, and most memorably rando backstabbing intergalactic randomness villain. We had a pair working on the test suite full time for about three months trying to resolve these issues. We tried about 1000 things and some of them worked. And I'm going to pass along the answers we found and the hypotheses that we didn't disprove. Honestly, I'm hoping that you came to this talk because you've had similar problems and you've found better solutions. So this is just what we found. I have a very important tool for this section of the talk. It's the finger of blame. We use this a lot when we were like, hey, could the problem be cucumber? And then we would go after that. So here comes finger of blame. Cucumber, capybara, poltergeist, definitely part of the problem. I've talked to enough other teams that use these tools extensively and the evidence from our audience, right? It's to know that the results are just not as deterministic as we want. When you're using multiple threads, and you're inserting against browser environment, you're going to have some issues. And one of those is browser environment. Browser environment is a euphemism for a complicated piece of software that itself is a playground for network latency issues and rendering hiccups and a callback soup. So your tests have to be written in a very specific way to prevent all the threads and all the different layers of code from getting confused and smashing into each other. Now some of you maybe are lucky and you use the right style most of the time by default. Maybe you don't see that many problems. A few things you got to never assume. Never assume the page has loaded. Never assume the markup you are asserting against exists. Never assume your age act requests actually finished. Never assume the speed at which things happen because until you bolt it down, you just don't know. So always make sure the markup exists before you assert against it. New capybara is supposed to be better at this. And it's improved. But I do not trust them. I am super paranoid about this stuff. This is a good example of a lurking rando due to a race condition in your browser. Capybara is supposed to wait for the page to load before it continues after the visit method. But I find it has sort of medium success with doing that. Bolt it down. Right. We used to have something called the wait until block. That would stop execution until a condition was met. That was great because it replaced sleep statements which is what we used before that. Modern capybara, no more wait until block. It's inside that has CSS and have content matcher. So always assert that something exists before you try to do anything with it. Sometimes it might take a long time. The default timeout for those capybara assertions is like five seconds. And sometimes you need 20 seconds. Usually for us that's because we're doing like a file upload or another lengthy operation. But again, never assume that things are going to take a normal amount of time. Race conditions. I would be out of line to give this talk without talking explicitly about race conditions. Right. Whenever you create a situation where a sequence of key events doesn't happen in a predetermined order, you've got potential race condition. So the winner of the race is random. And that can create random outcomes in your test suite. So what's an example of one of those? Ajax. Right. In Ajax, your JavaScript running in Firefox may or may not complete its Ajax call and render the response before the test thread makes its assertions. Now capybara tries to fix this by retrying the assertions. But that doesn't always work. So say you're clicking a button to submit a form. And then you're going to another page or refreshing the page. This might cut off that post request, whether it's from a regular form or an Ajax form, but especially if it's an Ajax request. As soon as you say visit all the outstanding Ajax requests, cancel in your browser. So you can fix this by adding an explicit weight into your cucumber step. When you need to rig the race, jQuery provides this handy counter dollar dot active. That's all the XHR requests that are outstanding. So it's really not hard to keep an eye on what's going on. Here's another offender creating database objects from within the test thread. What's wrong with this approach? Now if you're using MySQL, maybe nothing's wrong with this. And that's because MySQL has the transaction hygiene of a roadside diner, right? There's no separation. If you're using Postgres, which we are, it has stricter rules about the transactions and this can create a world of pain. So the test code and the Rails server are running in different threads. And this effectively means different database connections and that means different transaction states. Now there is some shared database connection code out there and I've had sort of mixed results with it. I've heard this thing, right, about shared mutable resources between threads being problematic. Like they are. So let's say you're lucky and both threads are in the same database transaction. Both the test thread and the server thread are issuing checkpoints and rollbacks against the same connection. So sometimes one thread will reset to a checkpoint after the other thread has already rolled back the entire transaction, right? And that's how you get a rando. So you want to create some state in your application to run your test against but you can't trust the test thread and the server thread to read the same database state, right? What do you do? So in our project we use a single set of fixture data. It's fixed at the beginning of the test run. And essentially the server thread or the test thread, sorry, treats the database as immutable. It is read-only and any kind of verification of changes has to happen via the browser. So we do this using Ryan D's fixture builder gem to combine the maintainable characteristics of factoryed objects with the like set it and forget its simplicity of fixtures. So any state that needs to exist across multiple tests is stored in a set of fixtures and those are used throughout the test suite. And this is great except it's also terrible. Unfortunately our fixture builder definition file is like 900 lines long and it's as dense as a master's thesis, right? It takes about two minutes to rebuild the fixture set and this happens when we re-bundle, change the factories, change the schema. Fortunately that only happens a couple of times a day, right? So mostly we're saving time with it but seriously two minutes as you're overhead to run one test is brutal. So at our stage we think the right solution is to use fixture builder sparingly, right? Use it for cucumber tests because they need an immutable database and maybe use it for core shared models for our spec but whatever you do do not create like a DC Comics multiverse in your fixture setup file with like different versions for everything because that leads to pain. Another thing you want to do is mutex it. So a key technique we've used to prevent database collisions is to put a mutex on access to the database. And this is crazy but you know an app running in the browser can make more than one connection to the server at once over Ajax and that's a great place to breed race conditions. So unless you have a mutex to ensure the server only responds to one request at a time you don't necessarily know the order in which things are going to happen and that means you're going to get unreproducible failures. In effect we use a mutex to rig the race, you can check it out on GitHub, it's just a sketch of the code we're using, it's omada health slash capybara sync. Faker! Some of the randomness in our test suite was due to inputs that we gave it. Our code depends on factories and the factories use randomly generated fake data to fill in names, zip codes, all the text fields. And there are good reasons to use random data. It regularly exercises your edge cases. Engineers don't have to think of all the possible first names you could use. The code should work the same regardless of what zip code someone is in. But sometimes it doesn't. For example, did you know that Faker includes Guam and Puerto Rico in the states that it might generate for someone? And we didn't include those in our states dropdown. So when a cucumber test edits an account for a user that Faker placed in Guam and their state is not entered when you try to click save and that leads to validation failure. And that leads to cucumber not seeing the expected results. And a test run from a new factory will not reproduce that failure. Right? Something crazy happened. Here we go. Times and dates. No, we're out of sync. Let me just... momentary technical difficulties. Okay. Times and dates. Another subtle input to your code is the current time. Our app sets itself up to be on the user's time zone to prevent time dependent data, like which week of our program you are on in the middle of Saturday night. And this was policy we all knew about this. We always used zone aware time calls except that we didn't. Like when I audited I found over 100 places where we neglected to use zone aware time calls. So most of these are fine. There's usually nothing wrong with epic seconds. But it only takes one misplaced call to time dot now to create a failure. It's really best to just forget about time dot now. Search your code base for it and eliminate it. Always use time dot zone dot now. Same thing for date dot today. That's time zone dependent. You want to use time dot zone dot today. Unsurprisingly I found a bunch of this class of failure when I was at RubyCon in Miami. So these methods create random failures because your database objects can be in a different time zone than your machine's local time zone. External dependencies. Any time you depend on a third-party service in your tests you introduce a possible random element, right? As three Google Analytics, Facebook, any of these things can go down. They can be slow. They can be broken. Additionally they all depend on the quality of your local internet connection. So I'm going to suggest that if you are affected by random failures it's important to reproduce the failure. It is possible. It is not only possible. It is critical. And any problem that you can reproduce reliably can be solved. Well at least if you can reproduce it you have a heck of a lot better chance of solving it. So you have to bolt it all down. How do you fix the data? When you're trying to reproduce a random failure you're going to need the same database objects used by the failing tests. So if you use factories and there's not a file system record when a test starts to fail randomly you're going to want to document the database state at the time of failure. That's going to mean YAML fixtures or like an SQL dump or something else clever. You have to find a way to reestablish that same state that was created at the moment that you had the failure. And the network. Great talk before about how to nail down the network. API calls and responses are input for your code, webmock, VCR, other libraries exist to replay third-party service responses. So if you're trying to reproduce a failure in a test that has any third-party dependencies you're going to want to use a library to capture and replay those responses. Also share buttons right in your cucumber test you're going to want to remove the calls to Google Analytics, Facebook light buttons, all that stuff from the browser. These slow down your page load time and they create unnecessary failures because of that. But if you're replaying all your network calls how do you know the external API hasn't changed? Right? You want to test the services that your code depends on too. So you need a build that does that. But it shouldn't be the main build. Purpose of the main build is to let the team know when their code is broken, when their code is broken. And it should do that as quickly as possible. And then we have a separate external build that tests the interactions with third-party services. So essentially external communication is off and then on and we check build results for both. So I want to talk about another reason the tests fail randomly. Our spec runs all your tests in a random order every time. And obviously this introduces randomness but there is a reason for that. And the reason is to help you stay on top of test pollution. Test pollution is when state that is changed in one test persists and influences the results of other tests. Changed state can live in process memory, in a database, on the file system, in an external service. Right? Lots of places. Sometimes the polluted state causes the subsequent test to fail incorrectly. And sometimes it causes the subsequent test to pass incorrectly. And this was such a rampant issue in the early days of our spec that the our spec team made running the tests in a random order the default as of our spec too. So thank you our spec. Now any test pollution issue should stand out. But what do you think happens if you ignore random test failures for like a year or so? Yeah. Here's some clues that your issue might be test pollution. Right? With test pollution the affected tests never fail when they're run in isolation. Not ever. And rather than throwing an unexpected exception, a test pollution failure usually takes the form of returning different data than what you expected. And finally the biggest clue that you might have a test pollution issue is that you haven't really been checking for test pollution. So we got to reproduce test pollution issues, which means we have to run the test suite in the same order. We have to use the fixture database data and the network data from the failed build. So first you have to identify the random seed. Maybe you've seen this cryptic line at the end of your our spec test output. This is not completely meaningless. 22164 is your magic key to rerun the test in the same order as the build that just ran. So you want to modify your dot our spec file to include the seed value. Be sure to format change the format to documentation as well as adding the seed. That will make it more readable for you so you can start to think about the order that things are running in and what could possibly causing your pollution problem. So the problem of test pollution is fundamentally about incorrectly persisted state. So the state that's being persisted is important. You want to ensure that the data is identical to the failed build. And there's lots of ways to do this. So you've got your random seed, you've got your data from the failed build, and then you rerun the specs.  You've correctly diagnosed that the issue is test pollution and you are on your way to fixing it. If you don't see the failure, maybe it's not test pollution. Maybe there's another aspect of your build environment that needs to be duplicated. But even then, say you've reproduced the problem. Now what? You still have to diagnose what is causing the pollution. You know that running the test in a particular order creates a failure. Problem with test pollution is that there is a non-obvious connection between where the problem appears in the failed test and its source in another test case. And you can find out about the failure using print statements or debugger, using whatever tools you want. But maybe you get lucky and you are able to just figure it out. But in a complex code base with thousands of tests, the source of the pollution can be tricky to track down. So just running through the suite to reproduce the failure might take 10 minutes. And this is actually terrible, right? Waiting 10 minutes for feedback, this is a source of cognitive depletion. All of the stack you've built up in your brain to solve this problem is disintegrating over that 10 minutes. You're going to work on other problems. You're going to check Facebook while those tests are running. You're going to lose your focus, right? And that is essentially how Rando wins.  Binary search. In code, debugging via binary search is a process of repeatedly dividing the search space in half, until you locate the smallest coherent unit that exhibits the desired behavior. Okay? So we have the output of a set of specs that we ran in documentation mode. This is sort of a high-level overview that you might see in Sublime, right? And in the middle here, this red spot is where the failure occurs. So we know the cause has to happen before the failure because causality. So in the green block at the top is that's the candidate block or the search space. So practically we split the search space in half and remove half of it. And if the failure reoccurs when we rerun with this configuration, we know that the cause is in that remaining block, right? But sometimes you've got more problems than you know. So it's good to test the other half of the search space as well. So if your failure appeared in step zero, you expect not to see the failure here. If you also see the failure here, you might have multiple sources of test pollution. Or more likely, test pollution isn't really your problem and the problem is actually outside of the search space. So here's a hiccup. Binary search requires us to remove large segments of the test suite to narrow in on the test that causes the pollution. And this creates a problem because random ordering in the test suite changes when you remove tests completely. Remove one test, the whole thing reshuffles on the same seed. So there's no way to effectively perform a binary search using a random seed. So here's the good news. It is possible to manually declare the ordering of your R-spec tests using this undocumented configuration option, order examples. So config.order examples takes a block and that'll get the whole collection of R-spec examples after R-spec has loaded the specs to be run. And then you just reorder the examples in whatever order you want them to be ordered in and return that set from the block. So that sounds simple. I made a little proto-gem for this. It's called R-spec manual order. And basically it takes the output of the documentation format from the test that you ran earlier and turns that into an ordering list. So if you take, if you log the output of your R-spec suite with the failure to a file, you'll be able to replay it using R-spec manual order and you can check that out on GitHub. So it's possible to reduce the search space and do a binary search on R-spec. And once you've reduced the search space to a single spec or a suite of examples that all cause the problem, you put your monkey brain in the position to shine against your test pollution issue, right? This is where it actually becomes possible to figure it out by looking at the context. I've gone in depth into test pollution because it's amenable to investigation using simple techniques, right? Binary search and reproducing the failure state are key debugging skills that you will improve with practice. When I started looking into our random failures, I didn't know we had test pollution issues. Turned out we weren't resetting the global time zone correctly between tests. This was far from the only problem I found, but without fixing this one, our suite would never be clean. So every random failure that you are chasing has its own unique story. There are some in our code that we haven't figured out yet and there are some in your code that I hope I never see. The key to eliminating random test failures is don't give up, right? Today we've covered things that go wrong in cucumber and capybara, things that go wrong in our spec and just general sources of randomness in your test suite. And hopefully you're walking out of here with at least one new technique to improve the reliability of your tests. We've been working with ours for about eight months and we're in a place where random failures occur like less than 5% of the time. And we set up a tiered build system to run the test sequentially when the fast parallel build fails. So the important thing is that when new random failures occur, we reliably assign a team to hunt them down. And if you keep working on your build, eventually you'll figure out a combination of tactics that will lead to a stable, reliable test suite that will have the trust of your team. So, thank you.


Hello and welcome to the session. I am Deepika here. Let's discuss the question which says Choose the correct answer in the following integral of under root of 1 plus x square dx is equal to a x upon 2 into Under root of 1 plus x square plus 1 by 2 log mod of x plus under root of 1 plus x square plus c b 2.3 into 1 plus x square raised to power 3 by 2 plus c into 1 plus x square raised to power 3 by 2 plus c and d x square upon 2 into under root of 1 plus x square plus 1 over 2 x square log of mod x plus under root of 1 plus x square plus c Now we have a special type of standard integral that is integral of under root of 1 plus a square d x is equal to 1 over under root of x square plus a square plus a square upon 2 log of mod plus a square plus c So this is the idea to solve the above question. So let's start the solution integral of under root of 1 plus x square the idea we have integral of under root of x square plus a square is equal to 1 over 2 plus a square plus a square upon 2 log of the root of x square plus a square upon plus x square d x is equal to 1 over 2 1 square log of mod x plus under root of x square plus 1 square being equal to the root of 1 plus x square upon plus x square Now after me I hope the solution is clear to you. Bye and take care.


The next session is very interesting. And I'm not just saying it because I have to say it, I'm saying it because we will be talking about something that has been and kind of like, sorry, the person who will be coming out from the brand. The brand was founded in 1948 based on the belief structure quality backed by values will be. And the same belief has led the company's flagship brand cycle pure agributies to the biggest incense manufacturer that can in the country today. Let's welcome our keynote speaker, Mr. Arjun Ranga MD cycle pure agributies and managing partner and Ranga Rao and sons who aims to grow the business ethically, collaboratively and sustainably. In his address, he will be speaking on enduring legacy, essentially, very essential for family business and values. Ranga Avre, sir, Namaskara, how are you? Sir, you're on mute. Namaskara, I'm doing good. Thank you so much. Welcome sir, over to you. I'm really excited to hear from you. Thank you so much. You know, in this, when I had to choose a subject to discuss today, I kept wondering, what is the greatest challenge that I face? I mean, third generation entrepreneur, grandfather started this business in 1948 was a real struggle, you know, the way he set up the business. Coming into the next generation, my father and uncles built the business to what it is today, solid foundation. And then I've been in the business now for 20 years. The biggest challenge and fear for me is whether I will be able to hand over to the next generation, something better and something more than I received. Okay, in terms of business value, as well as legacy. So I kept thinking, how do I communicate what we are, how we've grown to what we've become. And so I've created a small docket, a small presentation, I'm just going to go over it with you very briefly. And once I do that, I will then, you know, start a discussion where we can go over my experiences and we can talk in more detail. Okay, sounds good, Viva. Absolutely. So a vision for generations to come and that's actually the glasses that my grandfather used to wear. We are known as the NR group quickly, we have diversified businesses in the group. And Rangramansans is a parent business that hands the cycle agarbati's iris lifestyle home fragrance products, lia air freshness and car freshness this top of power bags. And so the Omshan the spiritual products of kum kum turmeric oil and all of that. They have a herbal extraction essential oil business called so we do floral extracts. Thanks and technologies is predominantly to aerospace and defense that's used to technologies via the way we do agree solar firms sense of the sensing devices and NR Foundation is what we are also proud of is our non for profit division where we make a real impact in the society that we are living in. Enduring legacy essential family business value so I want to first touch upon what actually family legacy means okay. I tried to kind of look around and I found some good content in a few sites and a few people have written about it and I put in my own words as well. So it's the core purpose of the family business that binds the family values and the business together with meaningful achievements across multiple generations.  And that actually constitutes the legacy of the family, and it has to be documented articulated and transmitted in the right way through proper storytelling. Okay, and that's our legacy is always paid forward. It also represents both tangible and intangible assets that the family has accumulated over the years it could be financial, social impact that you made, but most importantly the emotional value that a family one brings the legacy is determined by the emotional question that the family holds. So you know in our city, I know the legacy that the generation before me had built on the word the Ranga family. So the responsibility is with me the emotional question to be taken forward to the next generation. Also the legacy of a business or of a family. It's just not about looking back to what has been created, but it also kind of gives us a guideline of what we can expect to achieve going forward about how we treat our customers, how we innovate as an organization, also determines the organization. The legacy talks a lot about how we have actually leapfrogged through various stages of evolution of the family and also the business. One of the critical aspects, like I said, and this is one thing that I'm all constantly, you know, thinking is about how do I pass on more than what I received from the early generation. And legacy is a fundamental part of that because each family's legacy is unique, and there is no clear cut mantra for anybody to follow to pass on the legacy to the next generation, which encompasses business wealth, as well as the social question that you built and the emotional question that you built over the years. Okay, and you know it could be your bloodline and name the heirlooms of the family from what my grandfather had. And the other day, we were cleaning our house, and I found a table that my grandfather used to use 60 years ago. Now I've moved it to the museum. So these heirlooms are something that's very important part, a very integral part of legacy that needs to be safeguarded, you know the stories of the family, what we believe in, all of that. The legacy also includes the principles, the purpose of the values that are underpinned both the family and the business. So now that I've established what I think legacy means. I'll now talk about what I have had to experience and what I was handed over now have actually taken the legacy into tangible business ideas that can actually be implemented in the marketplace. Okay. And these are the core values that were handed down to me. This has been there from the 70 years of the business commitment to relationship with all stakeholders. With customers or vendors relationship is the key differentiated offerings of products and services through constant innovation, the keyword here being innovation and differentiation family business values with professional management. This means treat everybody like family, but become professional as soon as you can, and get professionals into your business ethical and collaborative growth, grow, but grow ethically and grow together. Transparency in all our operations and conduct. Transparency has been one of the key differentiators for us in our businesses. When I came back to the business in 2000, I could expand the business because we were a transparent organization, ethical organization so I could focus on growth and building the business and building on our core competence. So for me, transparency is a key aspect of our core value and be socially responsible and sustainable. So these are the core values that were handed down from to me from the earlier generation, and I've been able to build on that. Okay. Talk about ethical businesses. This is a ledger of my grandfather in 1951. Okay. If you can see here on the right side, drawing account. This is his expenses that he drinks in the office that he books as a personal expense. Okay, he doesn't book it in the company. I can't imagine this level of ethical and financial discipline and this is what my grandfather did and and that's kind of what's been ingrained in us and what is business is sacred protected, and then the family will thrive as well. Transparency in all business practices. So we are one of the first ones to bring an MRP into our products when it was not required, because we didn't want a consumer to be cheated we needed the consumer to know what he's paying for and what he's getting. So we were the first ones to put the net weight in the product as well, completely onto SAP now, all our distributors all 5000 of them are online real time ethical. We also follow global ifra international frequency such association standards for each and every ingredient that we use in our product. We are the only carbon neutral sustainable. We are the only fsc certified company that only Agrabati company that uses only fsc certified boards from regrown forests, 100% sustainable plastic materials we use as recyclable. Virgin polymer we use in each and every product of ours and by 2024 we are completely offset of plastic footprint as well so we're working on that also. Each and every product that's manufactured in cycle Agrabati is 100% carbon neutral we completely offset our entire carbon footprint.  Collaborative growth, you know we have all the standards occupation health and safety is critical aspect for us and certified for that as well. One of the proud things for me is our school for visually disabled girl children that we run. It's been going on for about 30 years now, hundreds of students have gone through it, completely blind girl children from rural parts of my so residential school funded by the company. We manage that school is just amazing girls that have graduated from school have now become teachers doing great across the board. This is a program for all the shop floor employees close to 500 of them in the company, all the children's education we fund from the company project prayer point is something we're doing in and around my store in about 10 slums. We're trying to rehabilitate slum children, get the parents into de addiction clinics and treatments as well. Apart from that through our social empowerment for women through our businesses we have huge initiatives across the country. Similarly, for example, we're working with tribal women almost 2000 of them I've got an employer and making Agrabati sticks for us. So this is socio economic integration that we've been able to do with our supply chain, close to 20,000 families are impacted, you know, through this initiative. Now for me personally, you know the sustainability goals that that UN has determined I put this in every presentation of mine because we all need to be aware we're all part of the same planet, same ecosystem. These are the 18 goals that the UN has set the right to eradicate poverty, zero hunger, good health and well being quality education, gender equality, clean water and sanitation, affordable and clean energy, decent work and economic growth, industry innovation and infrastructure, reduce inequality, sustainable cities and communities responsible consumption and production, climate action, life below water life on land peace justice and strong institutions, partnership for goals. So I strongly believe in the sustainability goals and I try to inculcate this in any activity that I do within the organization as well. Right. Ultimately, this is our purpose. This is what we believe we stand for doing the right thing since 1948, every single time from generation to generation. Right. So this is broadly, you know, a high level presentation of what the group stands for. And you know, Simon Sinek talks about the why of the business and for us. Right. Why cycle. These are a few of the things that I strongly believe in. And this is the purpose that we are all driven by as an organization. We export over 65 countries. We have a legacy of almost three generations of fragments creation. We follow all global standards. We plant trees that heal the earth for future generations with carbon neutral. We follow all ethical practices. We are in the process of getting our fair trade certification as well. We have our GRAS standards, which is generally recognized as safe materials. So, so this is where we are now open to questions. If there's anything that we can have as a discussion as well. Thank you so much. Thank you. Thank you. Fabulous discussion. We love everything that you said, but I'm glad we also have a rule here. So, Ruhail is the senior editor for Exchange for Media Group. Ruhail, over to you. Thank you. I'm forward for this discussion. Thank you so much. Thank you, Bebo. And thank you, Mr. Rao. I was listening to very keenly to what you said and rightly so. I mean, so many challenges the brand in its 73rd year, if I'm right, you know, carrying on from generation to generation with the same vigor and even more. The first question to you straight away, sir, is that how does the legacy brand ensure that it's not tied to its past and doesn't carry that baggage of, you know, does away from it and reinvent itself. And related question is how often do you challenge yourself as a brand as you move on from generation to generation. Yeah. So what happens is legacy leads to the values that define your brand and your company, right?  So there is no baggage at all. There's actually a lot of advantage in knowing where you came from so you know where you're going. So for me, I think our legacy actually is determined our future to a great extent. Like I said, many, many times we are at crossroads and we rely on our legacy and our values to determine the direction to take. We are always right when we go back to our values of ethical business practices, transparency in what we do, social impact and sustainability. So these are things that are part of legacy and they're never a baggage. They're actually an advantage and constant innovation is another mantra that we strongly believe in. As long as we keep reinventing and staying relevant, I think we will always be at the forefront of change and adapt to what is required for the family and the business to progress. But for me, I think legacy is an advantage. If you look at it in the right way and use it the way it's supposed to define the values of the company. Right. Mr. Mr. Ranga, I also want to ask you about, you know, we talk about this pandemic. I just want to revisit it. It's been a recent phenomenon for all of us and everyone, whoever we talk to says that a lot of reinvention happened during this phase. Giving a sense of your story as a leader because it was about leadership. Only those brands survived and did well who had the strongest leaders. From a leadership perspective, what are the big lessons to you? You know, the biggest lesson for me is that our values sustain no matter what the situation or the market condition. One of our key values is transparency.  Many of them volunteered to come forward and take payment, you know, holidays, for example, but as an organization, we stood by each and every individual in the company. I was out there as the leader creating a town hall session. I reached out to each and every one of our 3,000 employees on a real-time basis. I was in town halls day in, day out communicating to them, spreading the message of courage and telling them to stay, believe in themselves and ensure their safety. We also brought in a lot of processes to manage remotely. We moved to a work from home situation even before the lockdown was announced, moved all our systems to homes. We ran simulations as well, went to the bank borrowed money to be able to sustain salaries for everybody. So we are one of the few companies that did not lay off anybody and we also managed to ensure that everybody got their salaries on time, whether we were working or not. And the agarbhutis are not an essential product. So we were completely shut down during both the lockdowns, both during lockdown one and lockdown two. But with the proper planning from my team, we were able to sustain everybody in our ecosystem and do the right thing every time. So being at the helm of affairs for almost two decades now. As a leader, a lot of marketers are watching us, young leaders are watching us, they are all watching lockdown right now. To build an enduring brand, that's the same, the seasons of all sorts, in terms of the market dynamics. What are your big suggestions? I think believe in your brand and brand actually, you need to live what your brand stands for. You need to know why you exist. To be a purpose lead brand. See, for me, if anybody asks me, what business are you in? I'm not in the business of agarbhutis, I'm in the business of giving people hope. When you light an agarbhutis stick and when you pray for a better tomorrow, that's what I'm actually fulfilling and that's what I'm striving for. So the purpose why you exist, need to be very, very clear with the leader. And for me, it's very clear. I fulfill a very deep, emotive need to each and every person out there who prays. Okay, so once you have that squared and everything else falls in place, that's why we have 14 different quality checks, we have such a solid ORM and CRM process internally. That is the reason why we are the largest distributed brand in the country because we want to be out there helping people's prayers day in and day out doing the right thing every time. So you need to be driven by a tremendous purpose, solid self-belief in what you do and constantly innovate and unlearn and relearn and ensure the organization also stays relevant. For legacy brand leaders like you sir, I also want to understand during your course of presentation, you also mentioned that sometimes the fear that drives you because you want to contribute more to the next generation that would take on. On the other hand, we often talked about being fearless and relentless. So how do we match the two? This is definitely a tough situation to be in. I think fear is very, very important and not to be fearful, makes you humble, makes you learn, makes you do more. Okay, and I am constantly fearful but I also have courage to face my fears. That's important. So if you just stay fearful and don't build a system of courage to actually address your fears then you'll have a problem. So building process comes out of being fearful of failure and I'm a strong believer in building solid processes to scale for growth. And that's really helped me plan for the future as well. Example being we moved into SAP from Tali and then into Microsoft Navigin and now we have a Salesforce automation system where each and every all 1900 of our sales guys have a Salesforce automation app real time where I can track real time sales across the country. These things would not have happened if I didn't fear technology becoming an enabler and ensuring that each and every sales guy gets empowered to make a difference to his career and learn more. So fear kind of manifests in different ways and mostly if you understand what your fears are, it manifests in a positive manner. And for me that's always been the case. And the biggest fear for me is whether I'll be able to do justice to this legacy brand and hand it over bigger and better than what I was given from my father and uncles before me. And it's this not for the family, it's also for my employees who are equally family. Innovation is a great term used by all the brands at most of the times and it's like broad brush. But when I talked about how often do you look into yourself as a brand and look into where the deficiencies are. Is there a time period that brands do it because how often do they innovate because in an innovation means that you have to move the entire legacy footprint that is so big. How often should brands innovate? Is it tough for legacy brands to innovate and adapt because they have a lot of other things to think about? Innovation is not a timeline. Innovation is a state of mind to constantly look at opportunity, to constantly question what you're doing, to be willing to be disruptive in your activities. So I don't think innovation has a timeline of XYZ innovations that I've done. Innovations manifest into new product development or process re-engineering or digital transformation. So there are multiple ways in which innovation showcases itself. The way you know that you're constantly innovating and staying relevant is the fact that we've remained number one in the last 40 years. Since 1980, we're the number one brand of incense in India and today by volume we're the largest in the world. The only way you can sustain your market share and continue to grow and continue to delight your consumers if you constantly innovate and stay relevant. And that manifests in different forms, technology, social media, product, process, quality, all of that. Earlier in one of the sessions, somebody said the quality of a product is the best marketing campaign that one can do. Of course, your brand has that recall value, but how do you stay differentiated in a crowded market like India where the intent is so profusely? So it's everything, it's just not one thing, right? I mean, it's all the touch points that make you different and relevant. Being carbon neutral, using sustainable raw materials, using safe ingredients, all of the quality tests that we do on the product. All of this then transform into just not a product company but as a brand and the brand then kind of encompasses what we all stand for. And that's what a consumer actually buys into. It's not a transaction but it's a relationship for a long term. And if you believe in it and if you constantly keep communicating the same thing over a period of time, the consumers start believing it as well. And a true representation of that is the testimonials that we receive on our social media platforms about how people talk about generation to generation, contact with the brand and how it's making a difference in their lives real-time and how the day wouldn't start without lighting those two psychological mistakes. And so that actually talks about what you're doing real-time. Right. So since we're on a marketing forum and also want to talk about, over the last couple of decades that you've helped this brand, broad changes have happened in the marketing domain. Where have we arrived now? What are the best ways to touch a consumer that is constantly switching from one screen to another? Yeah. For me, simple basics that I learned when I joined the business still remain. Something like in a retail outlet, that's something basic that you learn. So ensuring that your product is visible, whether it be on the digital space or in the offline space, it's perpetual. How do you become visible? How do you stay relevant is the challenge and the number of mediums have increased. And the second issue is where is your TG residing constantly? That's been the biggest challenge, the millennials, the baby boomers and the current generation acts. Who is consuming what, where and how do I stay relevant to each and every one of them? Digital, social, offline, online and with the pandemic coming in, a huge amount of BTL activations that we used to do below the line at point of sale has changed because the transaction time in a retail outlet has dropped by 60% for non-essential categories like ours. So when a consumer is spending 60% lesser time in a retail outlet, the stories that you can tell him reduces. So how do you then get in touch with him and how do you then tell him what to stand for and what to believe in? So these challenges are real time and we are addressing it through of course social and digital. And even till today, ATL still remains the biggest opportunity of inner communication for us. The other way of addressing the concept of innovation is the disruption that we use, we call it disruption. If somebody has to build a brand today, the timeline and the age of the brand sometimes gets affected by the disruption that happens in the market. But you seem to be in a very privileged space in that way because your brand of course has sustained and very few brands have this kind of history. Tell me, from here on do we, when is the vision of the brand from here on? What is the vision that you have for your brand? The long-term vision is very simple. Anywhere in the world, anybody thinks of prayer, they need to think of cycle. That's the idea. I mean prayer and cycle need to go hand in hand. And the next level of achievement would be fragrance and prayer together. So that's the way we've defined what we stand for. See we are not a vision led brand per se but we're a purpose led brand. To do the right thing to fulfill hopes, to deliver hope each and every time with each and every prayer. And that's what we stand for as a brand as well. So in the long term, if you see any way there is prayer, I want to be present. So we have our spirituality website for soulweather.com which is an e-magazine. We have pureprayer.com which is actually an app and a website where you can actually go in and do pujas in temples. So we're trying to integrate the entire prayer gambit and entire prayer space. We've launched a whole range of prayer products called Om Shanti where you have puja oil, scam fur, all of that you can use. Right. Also the focus on people behind the brand has also holds immense significance. Also I want to understand from you, how would you define your style of leadership first of all? Being so successful year after year and target after target, how would you define your style of leadership? Well, I don't consider myself a very good leader in comparison to the leader that mentored me which is my father. But I believe that I am a very trusting leader. I delegate responsibility and I expect and provide the required training and mentorship and then believe in my team to be able to deliver. And one of the beliefs I have is that a leader is one who gets things done without telling people what to do. And I'm a firm believer of that. But also the paternalistic attitude of the family comes into me where I tend to micromanage and hand hold quite a bit and spoon feed. So it becomes easier for my team to come back to me with problems rather than solutions. And that's something I'm trying to improve upon as a leader as well is learning to let go and let them take the decision and also face the consequences accordingly. But I tend to hand hold and spoon feed quite a bit. That's been one of the challenges that I'm trying to overcome as well. So the leadership, well with the leadership stage, innovative at all times, which is a must in today's age that we live in. But how do you make sure that it trickles down to the rest of the organization and they have this innovative first, disruptive first approach. And we earlier talked about on-the-go leadership, like you give them that liberty to take the decision. How do you ensure it happens? No, there are so many processes. We strongly believe in Kaisen's in the shop floor, constant and small incremental increments. A reward system for Kaisen's that happen at the shop floor is what keeps us relevant and ensures that year in and year out we constantly deliver better and better quality to our consumers. So that's on the manufacturing side. We have the best quality management systems in place, best in class. We have all the protocols that we follow to constantly keep innovating. We have Kaisen's that we do. We have the quality circles. We have all of that that's happening constantly so we stay relevant and stay focused on what we need to deliver to the customer. But the busiest way and the biggest way is through folklore. You need to learn how to tell stories of innovation. We keep talking about what we keep doing in one place, keep communicating that to the other. Identify champions who can actually tell stories so that through folklore is the easiest and the best way to communicate what you stand for and to tell people how to constantly keep innovating. If you don't stay stories, if you don't learn how to tell stories within your organization, it seems to be relevant even to them. Okay, so for me storytelling is the best way to communicate what you stand for and to ensure that the team constantly know it. Thank you, sir. What a wonderful discussion. Thanks for joining us today. I'm sure the people who listen to us go away with a lot of enriched insight. Thank you and over to you. Thank you so much. I have a few questions from the people who have been watching us. So Mr. Ranga, please don't go. Thank you, Rohail. I've really enjoyed this entire discussion of yours because I am actually based out of Bangalore and I know a lot of friends and a lot of families with the second and the third generation of business. But then I think maybe the third or the fourth generation now is so overexposed to information and to opportunities that most of them are not very keen on continuing on the family vision. What is your take on that? I would love to understand that before I move on to the questions that the audience has asked. Yeah, see for me, my father and uncles took the responsibility of grooming our generation, inspired us to come back and join the business. So if my son or the daughters in our family don't come back, I would take it up as much as it's my failure as it's theirs. So yeah, it is my responsibility to inspire the next generation and they are always ready to get inspired. I need to show them the opportunity and show them what we can do and what difference we can make to the world if they work with the family and work with this business. And that's my responsibility. So if your friends are not doing what you think they should be doing, then you need to talk to their fathers, not to your friends. I really like that, you know, so confident, bold and straight to the point. Would love to have more conversation with you, but now I need to get back to my questions. My first question is, this is by Himanshi. Himanshi, thank you for asking in your question. The question is, your association with Sri Lanka versus South Africa has been very interesting. How does the collaboration align with your larger marketing strategy? See, we believe that prayer unites people. Okay. And we look at cricket as an activity that unites the nation. And we have just entered Sri Lanka as a market and we felt that we should partner with Sri Lanka and cricket and that's the reason why we sponsored the recent Sri Lanka, South Africa cricket series. So we have been in India cricket from 2005 and we will continue to be part of India cricket for years to follow. And for us, cricket has given us tremendous brand visibility across the board, predominantly in our trade and motivation for our sales teams as well. Absolutely. And the kind of prayers that happened during Indian cricket match. It's crazy. Absolutely. I will all be praying today for RCB as well. Yes. Yes, we are Karnataka boys and we hope that RCB does something better this time. My next question to you is, how do you manage to keep your positioning intact while diversifying into newer portfolios? See, as long as the core philosophy of the brand stays relevant, the positioning in the consumer's mind will not get diluted. See, one of the principles that the earlier generation told us that stood the test of time. What my father told us is that don't put your brand on a product if you're not sure of what positioning it's going to take in the consumer's mind. Once you're sure that the positioning is in tune with what the brand stands for, only then you attach the cycle logo onto that brand. And so we still follow that principle so we don't easily put our logo on every corner of the product so you can see it. So that's something that we're following and that's one of the biggest easiest ways of how we've ensured that the positioning stays intact because the brand doesn't get diluted. Brilliant. Thank you so much for your time. It was fabulous having you here. I'm sure a lot of us got to learn a lot. I'm not supposed to ask you any more questions but I'm just going to slide in one quickly. Did your grandfather write down something for the family value and that continued down like a book? Because what is said and what is seen, it is lost in a Chinese Whisper game. Oh yeah, my grandfather definitely had his memoirs. He's written from 1935 onwards and he's mentioned everywhere that I am writing this for my grandchildren so that they can read this one day. And there's almost a 300 page book that he's written for us to follow as guidelines of how to sell, what to do, how to behave, what's important in life, what's not. The importance of humility and everything is just amazing. It's inspiring actually. It's not public. Snippets of it has been made public but there's a lot of personal information about himself that he shares as well in that for us to learn from. So whatever we could make public, we made public. It's a Kannada book called Sugandhavarthi Rangarayaru. So we will get it translated into English and publish it as well soon. Thank you so much. I'm really looking forward to reading that book and having more conversations with you if we meet offline. Considering we stay very close to each other, Bangalore and Mysore's mother. Absolutely. Thank you and Jai Hind. Thank you. Thank you so much.


Hi, I'm Zor. Welcome to Unisor Education. We continue talking about atoms, and right now we will spend some time to talk about interaction between atoms. So, today's lecture is about chemical bonding between atoms. Now, this lecture is part of the course. The course is called Physics for Teens. It's presented on Unisor.com Totally free website without any advertisement. No need even to sign in unless you are engaged in some kind of supervisory education. The site is much more preferable as the source of these lectures than, let's say, if you find it on YouTube, because on YouTube you have like separate lectures, basically. That's where they are stored. But the Unisor.com presents a course, which means there is a menu. Every lecture has textual explanation. And there are exams, which you can take as many times as you want until you get the perfect score, obviously. And then, as I mentioned, there are certain other functionalities like supervisory education, if you wish to get engaged in it. Okay, so let's get back to chemical bonding. First of all, when we are talking about chemical bonding between atoms, we are talking primarily about interaction, which does not affect nucleus of the atoms. So, nucleus is completely unchanged during these combinations. So, the combinations are available on the level of electrons. So, interaction between atoms as far as chemical bonding is concerned is interaction between their electrons, how they are rearranging themselves to create this bonding. Okay, now, there are certain elements which can bond together, certain simple elements under certain circumstances. And there are complex combinations, the molecules which actually interact as well. Now, I will use one particular example in this lecture, which is the combination of two different atoms, primarily the sodium and chlorine. Yeah, chlorine, which combined together give you sodium chloride, which is actually a regular salt, which we are using in food. So, this is atom, and this is atom. They combine together and get a molecule of salt or sodium chloride, if you wish. So, we will examine primarily this particular type of combination in details, so you will have a feeling about how atoms interact with each other. Now, prior to that, I would like to talk about certain cases when atoms do not want to interact with each other. So, there are certain atoms which basically are very difficult, possible but under very extreme circumstances. Generally speaking they are not willing to get into any kind of chemical bonding with anything else. As examples, we will consider so-called noble gases. Now, the first noble gas is helium. And to explain how basically, why is it not really willing to get into chemical bonding with anything else, we have to go back to the electron structure within the atom of helium. So, we go back to something which we have already learned in the previous lectures. Remember, the electrons are surrounding the nucleus. They are basically organized in shells and shells are numbered like one, two, three, etc. Now, each shell has a certain number of sub-shells. The number of sub-shells corresponds to the shell number. So, shell number three has three sub-shells. Shell number one has one sub-shell. And sub-shells are also numbered one, two, three, four, five. However, for historical reason, people are using letters. And the first one is S. The second one is P. The third one is D. And I'm not going to go any further. We already did this. And under the circumstances which we will study, we don't actually need more than three sub-shells. So, the first shell has only one. The second has two. So, I can actually wipe out this. The third shell has three sub-shells, etc. Now, how many electrons are per shell? If you remember, there is a formula. For M is one of those numbers. So, S has two. One times four minus two. P sub-shell has six. And D sub-shell has ten electrons. So, this is electron structure of atom in general. And as far as Hellen is concerned, it has only two electrons in the first shell. So, the first shell is complete. So, it has two electrons. First shell S sub-shell, which is the first one. And it has two electrons. Now, there are no more sub-shells in this shell. And there is no more electrons which can fit into this sub-shell. So, we have one shell, one sub-shell, which is complete. There is no more room for anything else. Because to push something in, some electron in, which is not really easy, you have to really create a new sub-shell. Which is always difficult for whatever reasons. Okay, great. Next. Next, noble gas is neon. Which we are using like everywhere in neon lighting. Now, what is the electron structure of neon? Okay. First of all, it has ten different electrons and they are divided into layers like this. So, the first shell can have only one sub-shell and it's completely filled up. Now, the second shell can have two different sub-shells, S and P. So, S it has only two again. S shell always has two. And on the second shell, the P sub-shell, it has 0, 6. 2 plus 2 plus 6 is 10. It's 10 electrons. So, this has 2, this has 10. Now, again, the same situation. This shell has only one sub-shell and it's filled up. It cannot hold, S cannot hold more than 2.  And the P's can have 6. It's also filled up. So, what we have here is exactly the same situation. All the sub-shells are complete. To introduce something more we need to create a shell or to take electrons from it, which means that we will kind of work against the desire to be complete. So, Atom's desire to be complete, if you wish you can just formulate it this way, they are tending to be complete if possible. So, but this one is already complete. So, it does not really need any pairing with anybody to borrow electrons to complete its shells. So, that's why these are inert elements, these noble gases. Now, just for example, let's consider the next one. Next one is what? Argon. Argon is 18. And let me just write it straight through. The beginning is exactly the same. Now, we need 8 more. So, we have to start the new shell. The shell number 3 and it has S2 and P6. Again, we have started a new shell which can have up to 3 different sub-shells, but we don't need really 3rd one. 2 already sufficient. Both of them are filled up. S can have 2. P can have 6. They're filled up. And the total is 2 plus 2 plus 6, 10 and 18. So, everything is fine. Again, all the sub-shells are complete. They are filled to their capacity. And that's why it's inert gas. It's a noble gas. Just out of curiosity, one more. Krypton. Now, Krypton has 26, if I'm not mistaken, electrons. Now, the beginning is the same. So, I will put it here, like this. Argon. And then we have to add more. Actually, it's not 26. I skip. I think I skipped something. Because it has everything which has Argon plus it has 3d10 and 4s2 and 4s6. So, it has 18 more. So, it's 36. So, that's what's very important here. Now, again, what we have. This is complete. 3g. Now, d can have this. So, we complete the 3rd shell. And then we have to start the 4th shell. And again, the first and the second subshells, s and p. That's supposed to be p, are filled to their capacity. s to the 2 and p to the 6. And we have 36 electrons. Same situation, again and again and again. All these inert gases have complete subshells filled to the max. And that's what makes them unwilling to go into any combinations. Now, obviously, the next thing I would say, okay, those elements which do not have a complete structure of the top subshell, we're talking about usually the top subshell which is not filled up to capacity. So, all those elements are more willing to get into combinations. That will bring us to sodium chlorine. Okay, so let me just wipe out this. So, we know why noble gases are noble. Okay, so let's talk about sodium. Sodium has combination of 11 electrons. And let's start. The first subshell is complete. Now, the second shell has two subshells. Again p, s and p. 6. How many do I have? 2, 2, 6, 10. So, we start the third shell and we have, obviously, the only one electron. So, the third shell, the first subshell s, can have two. Now, we have one. So, what do we do to complete it? Well, either it should give one electron or it should take how many for s, or take another electron. Yes, that's where it is. It's supposed to be. Okay, now let's talk about chlorine. Now, chlorine is 17, if I'm not mistaken. Yes, 1 is 2. 2 is 2. 2 p, 6. Now, 3. We have to fill it up. I mean, s2. The first subshell. 3, 2, 6, 12. 5 more. Okay. The next one can have up to 6. But we have only 5. We have one less. And here, we have the most important things. You see, this thing can give up one electron to be complete. This thing needs one electron to be complete. Now, the desire to be complete is very, very strong. I don't know why. And what happens in this case, they are sharing the electrons and basically one electron comes from here to here. And what happens is the following. Sodium is kind of transforming itself into so-called sodium positive ion and give up negative electron. This electron is consumed by chlorine. It goes to this particular subshell. Well, not goes to. I mean, I don't know exactly how it happens. But somehow it happens that it goes into the sphere of influence, if you wish, of another nucleus. So, on the level which we are in right now, you can just, you know, consider this electron really kind of changes the place, although it's not exactly this. And what makes it is chlorine negative ion. So far all we have done is the electron goes from sodium to chlorine. Now, because electron is negative, whatever is left is positive ion of sodium. And when this electron is accepted by atom of chlorine into the topmost subshell, the atom becomes negatively charged basically. Now, what happens with positive and negative charges? Well, they attract. So positive ion plus negative ion attract together and that's what makes a molecule of salt. And because these are oppositely charged, electrically charged atoms, they stick together and that's what makes the molecule. So, the molecule is kept together by basically electrostatic forces, if you wish. Something like this. So, it's no longer the same atom of sodium and the same I should say sodium, sodium is later name. The same atom of sodium as it was before and this is not exactly the same atom of chlorine as it was because this guy lost an electron for the benefits of this guy. So, they are ions now. Ion is basically an atom which either gained or lost electrons, some electrons, one, two, whatever. So, that's what happened actually in this particular case and that's what makes the molecule. Now as a result of all these kind of manipulation with electrons, what I would like you actually to have like a final thought that the atoms themselves contain nucleus and electrons. Nucleus does not participate in bonding. Only electrons are rearranging somehow and this is an example. Now, there are more complicated examples which I don't want to go into because it's not the purpose. This is something like a chemistry course or whatever but from the physical aspects I would like you to understand that this exchange of electrons is at the heart of chemical bonding. Now, I have summarized whatever I was talking about in a few different rules if you wish and I'll just present it to you. Number one atoms like to be complete in the terms of their shells and sub-shells. So, again, why it's difficult for me to say it might be related to some deeper quantum properties, I don't know, but atoms like to have complete sub-shells and complete in these terms. So, every sub-shell by number, the first, the second, the third, has a certain number of electrons which make this particular sub-shell complete and that can be actually theoretically founded in some quantum mechanics. Now, since they do their, well, I should say desire or need to be complete is very, very strong. So, if there is a possibility for finding a pair which is also willing to complete, but differently, one atom is willing to complete by, willing to complete its sub-shell structure by, let's say, giving a certain number of atoms and if another atom at the same time is willing to accept these few electrons to make this complete so they should really kind of match to each other, you see. One electron is extra here. If we take it away, we will have a complete picture and one electron is needed here. So, one can be lost and one can be accepted and both will become complete. So, this is a pair. It's a suitable combination of atoms. So, if such a suitable combination exists when one becomes positive ion and another becomes negative ion, then there is a possibility for their chemical bonding into molecule. So, that's basically the rule. So, again, and by the way, it's not easy to part with an electron here. It's easier to accept. Why? Because the electrons are actually attracted by nucleus. So, we have to somehow rip it off from the nucleus. But again, the desire to be complete is probably stronger than the attraction of the nucleus and that's why an electron can leave this one and go here. Now, why is it not the other way around? Why not these five to go here to make this negative ion and this is positive? Well, probably because it's much more difficult to rip off five electrons from here than one electron from here. So, this is more natural kind of transformation. So, the electron from one to five, not five to one. Okay? Next. So, what we need is we need a proper effect between two different atoms to become chemically bonded. And what's also interesting is that it's like a marriage, if you wish. In some way, the relationship between these two components of the molecule, now in this case it's a simple molecule, they do actually behave like a happy marriage. When people complement each other, right, here is also this electron complements this. And that's why we have such a strong bondage and very stable molecule, in this case a molecule of salt. And what also I can say is that there are much more complicated molecules. But again, their principle of connecting of different atoms is exactly the same. So, one atom is hooked to another based on certain electrostatic forces. And then that one might be connected to another and another and we can have a structural formula of a molecule where atoms are connected to each other. But this is basically a course of chemistry which I don't want to go into. But if you do study chemistry, you will definitely be dealing with these structural formulas of molecules where you really see how different atoms are hooked to each other based on these type of connections. Okay, that's it for today. I suggest you to read the notes for this lecture, so go to Unisor.com. The course is called Physics for Teens. The part of the course is atoms. And when you open the menu it would be a chapter called Interaction of Atoms. Within that chapter this is the first lecture. Okay, thanks very much and good luck.