When you read source code, it should mean something. Variable names and function names are the first window you have on their functionality.
What is processSensorData returning? You look into the function, and you see that it has lines of code like this
And note, this may not be the best way to do this, some people would argue it's not even a good way, that you should split up the function into two functions (and they may well be right) but this shows the thought process of trying to make things easier to understand, and harder to get wrong.