remove unnecessary newlines