deletion of extra white spaces and deleting unnecessary lines