implemented another way of calculating fibonacci numbers