fix parse_input() and prepare to move to codeblocks