Not entirely sure what's changed here...
Removed regex pattern matching; now a simple interative parser.  Also
added a print statement for debugging in main