Improved test in and output