add assertion, exception handling, loggingin GUI