Function that takes 4 inputs, produces output.