Added output parsing, created main program logic.