First version of top down parsing algorithm