Added function state variables