adding dnd and changing the dom matches function to work faster