Input file functions  working