implemented readNcFile function