Tested and working text IO