finishing off eatrat function