Complete proof of concept (all tests passing).