Fixed some errors. Included a max tf diff filter between current and previous tf.