Refactoring and fixed the gui to finally support both analysis methods