fix newlines and other issues