All right, so you've learned that what you would like to do now is separate finding the genes from printing the genes. And the way we are going to do this is we're going to take all the genes you find and put them in a storage resource. Then you can iterate over that storage resource and print them out. Or if you wanted to do other things with the genes once you've found them, filter them, calculate properties about them, whatever. You could iterate over the storage resource and do those without reduplicating all of your code to have another thing that finds them all. So I've taken our code that prints all the genes which we developed in a previous video and I've made a couple small changes to it. So I changed it from being called printAllGenes to getAllGenes since we're going to get them instead of print them. It returns a StorageResource now because that's what it's going to give back as its answer, one of these things that holds all of these strings. I've altered the comments here with the steps to the ones that we developed in the previous video where we came up with the algorithm. And where these have been the same as before, which is most of the steps, I've left that code. For one of these, where we were previously printing it and are now adding it to a list. I deleted the old code, the System.out.println, which we don't want. But otherwise this is pretty much the same. And then, in our test methods, I've removed that code, because we're going to have to do something a little bit different. So let's start by turning these steps into code. Now the first thing we want to to is create an empty storage resource and call it geneList. So geneList is going to be a new variable. We need to declare that its type is StorageResource. geneList is its name. And it's going to be an empty StorageResource, a new one with nothing in it. It's going to be a new StorageResource. And then these steps are already translated to code until we get down here to where we want to take that gene and add it to our gene list. So that's just going to be geneList.add(gene);. And then at the end here, our answer is geneList. As you've seen many times by now, when your method or function knows its answer, it returns that answer to whoever called it. Okay? So now I want to write my method that's going to test this. And we're going to test it by printing things out. So the behavior of our code is going to be just what we did before but it's going to be more useful. More reusable, we can put it to other purposes than just printing out these genes. So the first thing I want to do is call this method, getAllGenes, that we just finished writing. And store its result in a StorageResource variable. Store, which I'm not sure I can spell. We'll just call this genes = getAllGenes on that DNA. Now we want to iterate over the things in it. So I have here the Duke Learn to Program documentation because I'm not very familiar with StorageResource. It's not one of the standard Java classes. It's kind of a nice simplification for you. If I didn't remember how to iterate over all of these things I could look at this and say okay, add, we just used that. Size. .data returns an iterable. Those are the things that we can write for each loops. It even gives us this little example here. So what we're going to do is for All of the strings, all of the genes which are strings in these genes we just got back, we want to print that particular gene out. I'm going to hit Compile. Whoops. Up here this was called currentGene. Java is fussing at me because it has no variable there called just gene. Fix that. And here, [SOUND], whoops, I looked up the method and then I forgot to call it. That was good, easy to fix. I'm going to get rid of this documentation. I'm going to come over here, and I'm going to make a new one of these. And then I'm going to run it. And it ran just fine and gave me the same results as before. But our code is now more reusable. We could put it to other purposes more easily.