Updated a lot of documentation and removed rendundant code in the
analysis thread