Initial working implementation.