Rewrote Parser class from scratch