Updated comments on the function