serial print speed

Change this Serial.begin(9600); to Serial.begin(115200); then retest and see if you can figure it out.