Finally, the completed code for the project.