adding an output with timestamp
more improvements