Added code to allow dynamic argument passing inside of function