Added code showing friend function