Added some new comments to explain about the functions