Solution to nth_fibonacci()