added a function to calculate timediffs
added result window