seperating generate and differntiate; not yet working