task02 -- change right recursion to left recursion