comments and logging function