removed recursive method and solved fib numbers linearly