Calculating the Nth Fibonacci number efficiently