updated example code with relationships.