add code to support input/output and method calls