the procedural sorting function you' write would need know which elements you want to sort with (here the second and third elements of the arraybut the index for every array of data would potentially be differentdepending on where in the array that data is stored for that source type thusin your sorting functionyou' need to run multiple if tests (based on the source typeto extract the correct field in the array to sort by butif you changed the key you're sorting by ( from the author' name to the date of publication)you would have to change the element index you're sorting against this means manually changing the code of the if tests in your sorting function it' easy to make such manual code change and test that the change worksif you only have few source types ( articles and books)but what if you have tens or hundreds of source typeswhat nightmareand as you make all those code changesthink of the number of possible bugs you may introduce just from keystroke errors alonebut in object-oriented programmingyou can switch the sorting key at will and have an infinite number of source types without any additional code changes ( no if tests to changethis is the power of oop over procedural programmingcode structured using an oop framework naturally results in programs that are much more flexible and extensibleresulting in dramatically fewer bugs exercise in extending the bibliography class exercise (writing out an alphabetically sorted bibliography)since we programmed book and article with write bib entry methodslet' take advantage of that write method write bibliog alpha for the bibliography class we just created that actually writes out bibliography (as stringwith blank lines between the entrieswith the entries sorted alphabetically by author name the bibliography should be returned using return statement in the method some hintselements of list do not have to all have the same type for loops do not only loop through lists of numbers but through any iterable this includes lists of any sortincluding lists of objects (such as book and article instances strings are immutableso you cannot append to an existing string insteaddo reassignment combined with concatenation ( = +