Added main to parse input and output results.