a nicer way to do fibd, in python and c++