allow arguments to be passed to functions

probably something in there that will break things, but passes all tests and works so far for simple cases