Improved Fibonacci algorithm - runs in O(n)