next function to write sketched out