Added some logic around argument passing