improved commenting function