Implemented ReadFile and WriteFile finctions