First working implementation.