convert a function with separate arguments into one with a single vector argument For use with optim.
Useful links