Added documentation to the function