read & write file functionality with tests created