added the ability to specify which fields to include in the output