added monitors for input/output semantics; tests pass