wrote initial cubic function generator code (compiled externally but without testing)