Simplify the code. There's no need to check whether we're increasing or decreasing...