completed code with fib function test working (till 13, after that segmentation fault)