Writing out array