added comment for each function