cleanup and fixed fileio for multiple digit numbers