added reading files from a directory
added reading of whole files