Code to use as a basic implementation of the ideas we'll need.