updated example with function that returns an array

Using the example in the README I was getting an error. When I checked the demo app I noticed that `fields` was a function that returned an array. When I changed my implementation, it worked.

This PR updates the example in the README. I'm happy to make other changes if desired.