It works. Changed construct and hardcoded filenames. Write functions take a parameter correctly.