calback with input and output data saved into a structure