remove extraneous lines and dots