modified select statement and printf to print out all fields