Added display and file write switch functionality.