cleaned dl function