added function-level comments