Finished parser, still needs testing and optimizing