added undo-functionality