cleaning up writetuples and testing