added plotting to test for timing of thread