first "complete" version of parser