moving barycentric out to its own module