Function passed by reference into variable passed by reference