updated problem 3 to accept multiple fields
problem 3 updated to accept multiple fields