added 'output fields' flag to restrict the fields output to a subset of the input