readFile function created