implemented some basic file io