created a Parser class to handle the parsing