dictionary logic