split into files, cleanup
refactoring part 2
clrf to lf fix
fixed a redirection operator bug