first working version of the arity-based dispatcher in java-land.
remove lots of debug output