fixed even more warnings
more i/o simplification