basic working version of the parser