added better first/second derivative toggle