added writeTD6405.R