left recursion implemented