created io.c for input and output functions