worked on toFileSystem method