modfied to print list of fieldnames