How to connect a function to its argument