Patching deviance calculations on way to vectorizing