Serial communication does not work correctly between Arduino and Processing

A part of the arduino code

So, you were looking for a part of an answer? Somehow, I don't think so.