re-introduce graph width detection