Added the docstrings for the function in td1-5.4.
Added the script answering the 2.1 question of TD2.
Added the script answering the 2.2 question of TD2.
Added the script answering the 2.3 question of TD2.
Added the script answering the 3.1 question of TD2.