Refactoring code and add comments to make it more readable.
Refactoring code and add comments to make it more readable.