added file to memory

Added function to read text of file to memory.