remove extraneous characters