first implementation of the parser