huge changes, worked, newline/carriage return bug fixed