distances histogram