Updated to function definitions

The file has been updated to include comments that describe what the
function takes and arguments and what it returns.