resolve uninitialized $output variable
add comment to changed code