Task2: implemented file operations