optimized memory usage and implemented GUI System