Assignment completed
added comments to clarify the function utilities