Change GUI. Add lock function. Optimization