So far, we've been using variables to store individual values. For example: treePos_x, cloudPos_x, but when you get lots of variables, there's a neater way of dealing with this and that's to use objects. I'm going to show you how to use those now. So, in this sketch, I have lots of variables now for my tree. I have the exposition, the trunk height, trunk width and also one for the radius and a clue that we could combine these into an object is the fact that I've used the word tree in front of each of them. So, what I'm going to do is I'm going to first of all declare and initialize a tree object. I do this in a similar way to the way I've made the other variables. I type the var keyword and I'm going to call this object tree. The next thing to do is to initialize it and so I'm going to do this in the setup function. Now, the syntax here is slightly different. I am going to type tree equals and then I'm going to use the two curly braces to make an empty object and I'll put a semicolon at the end. Okay. The next thing to do is to add the properties and I'm going to add one property that each of these variables and I'm simply going to take the second part of the name. So, I'll start with pos x. I type pos x and the next thing I do is I put a colon. That's the two dots on top of each other afterwards. Now, I'm going to set an initial value and the way I do this is simply to type the number in here. So, I'm going to use the same number as I already used. I'm going to use 256. Now, for the second property, I need to separate the two items with a comma. So, I'm going to add now trunk height. Again, setting the initial value. Again, I'll need a comma for the next property and I'm going to just go for it and finish this off. Okay. So, I have my object ready to go. One thing I should point out is just make sure you don't put a comma after the last item. So, the commas are only to separate the different properties. The next thing to do is to actually use these properties in our drawing code. So, I'm going to do one to start off with and show you how to do it manually. So, I can see treePos_ x here and I want to now replace it with the property pos x from my tree object. So, to do this, I'm going to delete that one and I'm going to type tree and then I use the dot to access the properties and as soon as I type the dot, brackets is really helpful and it offers me a list of the different properties that I can use. In this case, I want to use pos x and so I just click on pos x. Now, I could go through and do this for the rest of my variables in this way but it's quite slow and it is also likely that I might make a mistake. So, there's a much better way of doing this and that's to use find and replace in the editor. So, I'm going to do this now. So, I go up to find and I choose to replace item from that menu and the first thing I want to do is to replace any instance of treePos_x with tree.Pos_x like this. I'm going to do it manually because the ones where I've declared my variables, I don't really want to replace those. So, I want to replace this one, I don't want to replace this one and I don't want to replace that one. Okay. So, I've done that one and I'm now going to go on and do trunk height. So I will just take this list of code and select replace and I want to replace this one with tree.Trunk Height. Again, I'm going to just go through one by one just to make sure I don't make replace any ones that I don't want to replace. So, I don't want to replace that one. I do want to replace this one. I do want to replace this one. Likewise. No, I don't want to replace those. Okay, that's one done. Let's do the over two. So, we can see now the object is finished and the tree looks exactly the same as it did before, which means that this has worked. So I can now hopefully delete my variables and the tree should remain as before. So, I'll delete all the declarations here and I'll delete the initialization there. Excellent. So, it all looks as before and now my code is a lot cleaner and a lot better organized. Finally, I might want to start changing some of these properties. So I could, for example, make the exposition a different number or change the trunk height. I could increase the radius of the leaves or change the trunk width. Okay. So, a good rule of thumb for when you should be using objects instead of just individual variables is that all of the different variables are actually describing the same entity. So, in this case, it would work because it was a tree, but for example, it wouldn't work to combine the tree and the cloud into a single object. That would be quite strange. Another hint, but it's a good idea to use an object, is when you find that you've put the same word in front of every variable. So, that might be cloud pos x, cloud size, cloud this or tree this at all the way through. At that point, it's probably a good idea to make it an object.