friendship functions adjusted