small changes to dl algorithm