Added threshold filter and writer.