Added revert function.