modified missing value handling

I would suggest breaking this line up to improve clarity, use some explanatory variables.