Updated code
update code
Updated code and refactored.