Fix #2 by passing a function to `apply` `f`

Thanks to @Frozenlock for finding this and offering a fix.