Added tasks 3 to 5
Improved code formatting