removing extraneous spaces