Task1 tail recursion optimtization
Task 2