Corrected fibonacci function to generate nth number in Fibonacci series