added most of a parser