Modified code and added relationship property.