finished first version of parser