uses memcpy to save things in the buffer that we send over