implement 'parser2' and add some tests