Dog does trick to earn treats