Added relation() function to return relation info