added friend fn and class