use byte pointers to save mem, only write if there are bytes to write