Why do you have all those delay()s in your read code? They are causing your read code to be a lot slower than it could be.
There are a number of coding styles, with respect to position of the curly braces and code. None of them suggest jamming code up tight against a {, on the same line. There are good reasons why that style has not seen widespread use.
if (!Serial.available()) {}
If and while do completely different things. They are not interchangeable.
You have quite a few of these where you need to have while statements.