Working basic parsing algorithm.