implement robust parsing, update tests