Please help me understand this code

So this is your goal?

EDIT: sorry, you aren't the OP so it isn't "your" goal, but you just tested the quality. Thanks.

Yep! Gernerally any Serial in the ISR should be avoided, anyway why just 19200? I don't know if increasing that serial speed up to 921600 could mitigate the count errors.