US bank JPMorgan Chase has returned to advertising on YouTube only after developing its own algorithm that ensures its ads are not placed around questionable content.

The tool was built by the bank’s internal media buying team, according to Business Insider.

It consists of 17 filters that classify YouTube channels into “safe” and “unsafe” for the brand’s ads.

See also: P&G slashed the number of sites it ran ads on by nearly 70% after YouTube brand safety scandal

The tool was developed after JPMorgan Chase along with dozens of advertisers pulled back from YouTube last spring when media reports highlighted ads appearing next to hate videos.

“When news broke about ads finding their way next to horrific pieces of content, we paused our efforts and pulled our ads from YouTube,” Jake Davidow, the executive director of media and channel strategy at JPMorgan Chase, told Business Insider. “We wanted to figure out a scalable solution and make sure we got it right.”

The team began working on the YouTube algorithm in August and rolled it out in October.

See also: Facebook ramps up video offer with revamped Watch tab

“The model that Google has built to monetize YouTube may work for it, but it doesn’t work for us,” said Aaron Smolick, executive director of paid-media analytics and optimization at JPMorgan Chase. “The attention of protecting a brand has to fall on the actual people within the brand itself.”

This story first appeared in Campaign.