added eat and attack function