Added functionality for the third tab, refactoring.