tested correct implementation of the parser, and seems to be getting good behaviour. Added error handling code. Need to test bad cases.