cleaned code, fixed some memory leaks, refactored, fixed errors to compute LGT, general errors, fixed GUI