partial solution (commented) for removing spans