added latest tests and fixed trim newline at the start of line