If any of the original inputs are NA, this will

cause the code to crash