Added Undo /  Redo and Optimize for Debug