add friendFunction and change the structure of proj