added centroid and area functions and tests