More features for i/o, use unit numbers in main