added comments at the function requested.