Some functions from LogViewer 1