f-d function fixed

Now f-d function is returning correctly: 2 1 1 4 1 1 6 1 1 8 ...