Implemented a rather robust parser.