ascii input support
reorganize functions and remove debugging statement (...)