on fib (n)
if n<2 then return n
fibPrev = 0
fib = 1
repeat with i = 2 to n
tmp = fib
fib = fib + fibPrev
fibPrev = tmp
end repeat
return fib
end