added optimized fibonacci function

probably will be useful for memory allocation and stuff
implemented some more get/setters