Testing Write Function