added sample in/out