Did refactored and added comments
Did refactored and added comments