The sketch implementation.