Added  parser constructor and main functions