Little changes: var names, threshold and inverse function