print_output split into smaller functions, and script now takes coverage file as optional input.