adding the stata write functions