Implementation of third pass.