added searching for centroid of head