working removeUselessDivs function