add example using functions from a struct (Resource)