Reference implementation.