Changed parsing algorithm