defined constructor and destructor
added somethings in centroid class