Fix the math so that the graph doesn't come up upside-down.