Added writeFile and readFile methods