Adding code for removing extra newlines