rejigg Main in preparation for graphical output