added support for 2 argument function objects passed to Scala methods