partially working version timeAnalysis.cpp