fixed malloc, working on differentiation routine