Is there a neat code way of determining if a variable is increasing or decreasing over time, or should I loop back through the prior values?