added a friend function