James C - type inference (untested)