Implemented new-file functionality