some simple functions to read a file