Adapted IP tutorial by introducing the two ways to call functions: output=func(input) and func(input,output)