formatted code with comments