First implementation of the first pass.