serial input to arduino

The if test will not be reached unless the while test concluded that there was serial data.

Not true. Look it up and find out why!