Improved code and commented lines