working version of parser