changed the parser to reduce it from n^2