changed barycenter to center
refacto 1/2 : pseudo-OO
refacto 2/2 : struct