added documentation to the functions