updated to support MAC style line endings.