Some GUI and optimization