Added a mutex to get more thread safety
Changed output format of time strings for hours