Eating function and array