finished one-function-to-rule-them-all