Added getCenter function.