Added optional portion size for eat function, also added ref to some
global state variables.