removed for loops
More flexible printing of function derivatives