re-documented the function