some mucking about with i/o for smoothness of use.