This chunk of code has been moved to a separate function, called 'treat'.