Working C input file reading