making graph work in 1d too