replace wasted spaces and tag