REFACTORING: Changed if / else cases to optimize the performance for the
default cases.
TEST: Added NaN cases to the missingPoints test.