Implemented queue with undo and flush possiblity.