Reduce scope of simplex gradient function